Skip to content

Commit 1dca160

Browse files
committed
Hide search box if a node is selected/clicked
Refs pombase/pombase-gocam#108
1 parent d93ecb2 commit 1dca160

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

gocam_view/templates/gocam_view/index.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,14 +1010,20 @@
10101010
}
10111011
});
10121012

1013+
const searchBoxDiv = document.getElementById('search-box');
1014+
1015+
window.hideSearch = function() {
1016+
searchBoxDiv.style.display = 'none';
1017+
}
1018+
10131019
cy.elements().bind("click", (event) => {
10141020
const data = event.target.data();
10151021
currentData = data;
1022+
hideSearch();
10161023

10171024
updateDetails();
10181025
});
10191026

1020-
const searchBoxDiv = document.getElementById('search-box');
10211027
window.showSearch = function() {
10221028
if (searchBoxDiv.style.display == 'none') {
10231029
showCyPanel();
@@ -1026,7 +1032,7 @@
10261032
currentData = undefined;
10271033
updateDetails();
10281034
} else {
1029-
searchBoxDiv.style.display = 'none';
1035+
hideSearch();
10301036
}
10311037
}
10321038

0 commit comments

Comments
 (0)