Skip to content

Commit 5bea495

Browse files
authored
Merge pull request #30 from ESA-PhiLab/persistent-mask-visibility
Persistent mask visibility
2 parents e6909e0 + e41f30b commit 5bea495

6 files changed

Lines changed: 15 additions & 12 deletions

File tree

iris/segmentation/static/javascripts/segmentation.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ let commands = {
5151
"key": "A",
5252
"description": "Use the AI to help you filling out the mask"
5353
},
54-
"toogle_mask": {
54+
"toggle_mask": {
5555
"key": "Space",
5656
"description": "Toggle mask on/off"
5757
},
@@ -100,7 +100,7 @@ let commands = {
100100
},
101101
"show_view_controls": {
102102
"key": "V",
103-
"description":"Toogle display of view controls on/off"
103+
"description":"Toggle display of view controls on/off"
104104
},
105105
"next_view_group": {
106106
"key": "B",
@@ -269,7 +269,7 @@ function key_down(event){
269269
} else if (key == "KeyN"){
270270
dialogue_reset_mask();
271271
} else if (key == "KeyV"){
272-
vars.vm.toogleControls();
272+
vars.vm.toggleControls();
273273
} else if (key == "KeyB"){
274274
vars.vm.showNextGroup();
275275
} else if (event.shiftKey){
@@ -898,9 +898,9 @@ function show_mask(visible){
898898
}
899899

900900
if (vars.show_mask){
901-
get_object("tb_toogle_mask").classList.add("checked");
901+
get_object("tb_toggle_mask").classList.add("checked");
902902
} else {
903-
get_object("tb_toogle_mask").classList.remove("checked");
903+
get_object("tb_toggle_mask").classList.remove("checked");
904904
}
905905
}
906906

iris/segmentation/templates/segmentation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
<img src={{url_for('segmentation.static', filename='icons/ai.png')}} class="icon" />
111111
</li>
112112
<li class="toolbar_separator"></li>
113-
<li class="toolbutton icon_button" id='tb_toogle_mask' onclick="show_mask(!vars.show_mask);">
113+
<li class="toolbutton icon_button" id='tb_toggle_mask' onclick="show_mask(!vars.show_mask);">
114114
<img src={{url_for('segmentation.static', filename='icons/show_mask.png')}} class="icon" />
115115
</li>
116116
<li class="toolbutton icon_button" id='tb_mask_final' onclick="set_mask_type('final');">

iris/static/javascripts/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ function open_tab(tab_button, tabs_class, tab_id) {
220220
tab_button.classList.add("checked");
221221
}
222222

223-
function toogle_display(button) {
223+
function toggle_display(button) {
224224
/* Toggle between adding and removing the "active" class,
225225
to highlight the button that controls the panel */
226226
button.classList.toggle("checked");

iris/static/javascripts/views.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ class ViewManager{
210210
}
211211
this.show_controls = show;
212212
}
213-
toogleControls(){
213+
toggleControls(){
214214
this.showControls(!vars.vm.show_controls);
215215
}
216216
}
@@ -419,6 +419,9 @@ class RGBLayer extends CanvasLayer{
419419
ctx.drawImage(
420420
image, 0, 0, image.width, image.height
421421
);
422+
423+
// Set mask visibility based on current vars.show_mask
424+
show_mask(vars.show_mask);
422425
}
423426
}
424427

iris/user/templates/user/config.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
</div>
55

66
<div id='config-segmentation-ai' class='iris-tabs-config tabcontent' style='display: block;'>
7-
<div class="accordion checked" onclick="toogle_display(this);">Model Parameters</div>
7+
<div class="accordion checked" onclick="toggle_display(this);">Model Parameters</div>
88
<div class="panel" style="display: block;">
99
<table>
1010
<tr>
@@ -77,7 +77,7 @@
7777
</tr>
7878
</table>
7979
</div>
80-
<div class="accordion checked" onclick="toogle_display(this);">Model Inputs</div>
80+
<div class="accordion checked" onclick="toggle_display(this);">Model Inputs</div>
8181
<div class="panel" style="display: block;">
8282
<table>
8383
<tr>
@@ -139,7 +139,7 @@
139139
</tr>
140140
</table>
141141
</div>
142-
<div class="accordion checked" onclick="toogle_display(this);">Postprocessing</div>
142+
<div class="accordion checked" onclick="toggle_display(this);">Postprocessing</div>
143143
<div class="panel" style="display: block;">
144144
<table>
145145
<tr>

iris/user/templates/user/show.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h2 style="margin-bottom: -20px;">{{user.name}}<h2>
2222
<span class="tag red">not tested</span>
2323
{% endif %}
2424
<p></p>
25-
<div class="accordion checked" onclick="toogle_display(this);">Segmentation</div>
25+
<div class="accordion checked" onclick="toggle_display(this);">Segmentation</div>
2626
<div class="panel" style="display: block;">
2727
<h3>Stats</h3>
2828
<table style="width:40%">

0 commit comments

Comments
 (0)