fix: [main] Prevent setting listeners if dependencies are not loaded

pull/85/head
Sami Mokaddem 2021-12-20 15:26:36 +01:00
parent e22068ec90
commit 7f9418639e
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 6 additions and 4 deletions

View File

@ -279,10 +279,12 @@ $(document).ready(() => {
overloadBSDropdown(); overloadBSDropdown();
addSupportOfNestedDropdown(); addSupportOfNestedDropdown();
const debouncedGlobalSearch = debounce(performGlobalSearch, 400) if (window.debounce) {
$('#globalSearch') const debouncedGlobalSearch = debounce(performGlobalSearch, 400)
.keydown(debouncedGlobalSearch) $('#globalSearch')
.keydown(focusSearchResults); .keydown(debouncedGlobalSearch)
.keydown(focusSearchResults);
}
$('.lock-sidebar a.btn-lock-sidebar').click(() => { $('.lock-sidebar a.btn-lock-sidebar').click(() => {
const $sidebar = $('.sidebar') const $sidebar = $('.sidebar')