js/events: initialize only existing search field
Formlerly JS failed on layouts without menu, should be fixed now.
This commit is contained in:
parent
d155c7a3fc
commit
194914917a
|
@ -29,11 +29,6 @@
|
||||||
this.applyHandlers($('#layout'));
|
this.applyHandlers($('#layout'));
|
||||||
this.icinga.ui.prepareContainers();
|
this.icinga.ui.prepareContainers();
|
||||||
this.icinga.ui.prepareMultiselectTables($(document));
|
this.icinga.ui.prepareMultiselectTables($(document));
|
||||||
|
|
||||||
// Remember initial search field value if any
|
|
||||||
if ($('#menu input.search').val().length) {
|
|
||||||
this.searchValue = $('#menu input.search').val();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// TODO: What's this?
|
// TODO: What's this?
|
||||||
|
@ -81,6 +76,12 @@
|
||||||
|
|
||||||
// replace all sparklines
|
// replace all sparklines
|
||||||
$('span.sparkline', el).sparkline('html', { enableTagOptions: true });
|
$('span.sparkline', el).sparkline('html', { enableTagOptions: true });
|
||||||
|
|
||||||
|
var searchField = $('#menu input.search', el);
|
||||||
|
// Remember initial search field value if any
|
||||||
|
if (searchField.length && searchField.val().length) {
|
||||||
|
this.searchValue = searchField.val();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue