Skip to content

Commit 11f26f6

Browse files
committed
Focus search box and clear panel on button click
Refs pombase/pombase-gocam#108
1 parent db3d64d commit 11f26f6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gocam_view/templates/gocam_view/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,9 @@
10201020
window.showSearch = function() {
10211021
if (searchBoxDiv.style.display == 'none') {
10221022
searchBoxDiv.style.display = 'block';
1023+
searchInput.focus();
1024+
currentData = undefined;
1025+
updateDetails();
10231026
} else {
10241027
searchBoxDiv.style.display = 'none';
10251028
}
@@ -1044,7 +1047,6 @@
10441047
break;
10451048
}
10461049
}
1047-
updateDetails();
10481050
};
10491051

10501052
const searchInput = document.getElementById('search-input');
@@ -1055,6 +1057,7 @@
10551057
if (searchText.length >= 2) {
10561058
doSearch(searchText);
10571059
}
1060+
updateDetails();
10581061
});
10591062

10601063
});

0 commit comments

Comments
 (0)