events.js: Some code style fixes in function applyHandlers

refs #9869
This commit is contained in:
Johannes Meyer 2015-08-10 13:24:59 +02:00
parent d09ad2641f
commit 6d24e09479
1 changed files with 16 additions and 15 deletions

View File

@ -30,37 +30,38 @@
}, },
// TODO: What's this? // TODO: What's this?
applyHandlers: function (evt) { applyHandlers: function (event) {
var el = $(evt.target), self = evt.data.self; var $target = $(event.target);
var self = event.data.self;
var icinga = self.icinga; var icinga = self.icinga;
$('.dashboard > div', el).each(function(idx, el) { $('.dashboard > div', $target).each(function(idx, el) {
var url = $(el).data('icingaUrl'); var $element = $(el);
if (typeof url === 'undefined') return; var $url = $element.data('icingaUrl');
icinga.loader.loadUrl(url, $(el)).autorefresh = true; if (typeof $url !== 'undefined') {
icinga.loader.loadUrl($url, $element).autorefresh = true;
}
}); });
var moduleName = el.data('icingaModule'); var moduleName = $target.data('icingaModule');
if (moduleName) { if (moduleName) {
if (icinga.hasModule(moduleName)) { if (icinga.hasModule(moduleName)) {
var module = icinga.module(moduleName); icinga.module(moduleName);
// NOT YET, the applyOnloadDings: module.applyEventHandlers(mod);
} }
} }
$('.icinga-module', el).each(function(idx, mod) { $('.icinga-module', $target).each(function(idx, mod) {
var $mod = $(mod); var $mod = $(mod);
moduleName = $mod.data('icingaModule'); moduleName = $mod.data('icingaModule');
if (icinga.hasModule(moduleName)) { if (icinga.hasModule(moduleName)) {
var module = icinga.module(moduleName); icinga.module(moduleName);
// NOT YET, the applyOnloadDings: module.applyEventHandlers(mod);
} }
}); });
var searchField = $('#menu input.search', el); var $searchField = $('#menu input.search', $target);
// Remember initial search field value if any // Remember initial search field value if any
if (searchField.length && searchField.val().length) { if ($searchField.length && $searchField.val().length) {
self.searchValue = searchField.val(); self.searchValue = $searchField.val();
} }
if (icinga.ui.isOneColLayout()) { if (icinga.ui.isOneColLayout()) {