Skip to content

Commit 6ad4b5f

Browse files
committed
show active btn
1 parent 9faaff8 commit 6ad4b5f

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

apps/labeling/roiMarking.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,8 @@
8989
<style type="text/css">
9090

9191
.selected_button {
92-
background-color: #365f9c;
93-
color: #fff;
94-
92+
background-color: #365f9c !important;
93+
color: #fff !important;
9594
}
9695
.item_head {
9796
margin: 0.2rem;

apps/labeling/roiMarking.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,22 +1170,32 @@ let prevLabel = false
11701170
"color": "#FF0000"
11711171
}
11721172

1173-
function setActiveVisual(x){
1173+
function setActiveVisual(title){
1174+
// unselect any which may be active
1175+
const oldSelection = document.getElementsByClassName("selected_button");
1176+
for (let x of oldSelection){
1177+
x.classList.remove("selected_button")
1178+
}
1179+
// select the correct one
1180+
const newSelection = document.querySelectorAll('[title="' + title + '"]');
1181+
for (let x of newSelection){
1182+
x.parentElement.classList.add("selected_button")
1183+
}
11741184

11751185
}
11761186

11771187
function labelTumor(e){
1178-
console.log(e)
1188+
setActiveVisual("Tumor");
11791189
startLabeling(tumorLabel)
11801190
}
11811191

11821192
function labelStroma(){
1183-
console.log(e)
1193+
setActiveVisual("Stroma");
11841194
startLabeling(stromaLabel)
11851195
}
11861196

11871197
function labelLymph(){
1188-
console.log(e)
1198+
setActiveVisual("Lymph");
11891199
startLabeling(lymphLabel)
11901200
}
11911201

0 commit comments

Comments
 (0)