From 6d24e09479e954a14b89d43e742cb7e1ad15227d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 10 Aug 2015 13:24:59 +0200 Subject: [PATCH] events.js: Some code style fixes in function applyHandlers refs #9869 --- public/js/icinga/events.js | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js index 09781e6f8..9eed7f566 100644 --- a/public/js/icinga/events.js +++ b/public/js/icinga/events.js @@ -30,37 +30,38 @@ }, // TODO: What's this? - applyHandlers: function (evt) { - var el = $(evt.target), self = evt.data.self; + applyHandlers: function (event) { + var $target = $(event.target); + var self = event.data.self; var icinga = self.icinga; - $('.dashboard > div', el).each(function(idx, el) { - var url = $(el).data('icingaUrl'); - if (typeof url === 'undefined') return; - icinga.loader.loadUrl(url, $(el)).autorefresh = true; + $('.dashboard > div', $target).each(function(idx, el) { + var $element = $(el); + var $url = $element.data('icingaUrl'); + if (typeof $url !== 'undefined') { + icinga.loader.loadUrl($url, $element).autorefresh = true; + } }); - var moduleName = el.data('icingaModule'); + var moduleName = $target.data('icingaModule'); if (moduleName) { if (icinga.hasModule(moduleName)) { - var module = icinga.module(moduleName); - // NOT YET, the applyOnloadDings: module.applyEventHandlers(mod); + icinga.module(moduleName); } } - $('.icinga-module', el).each(function(idx, mod) { + $('.icinga-module', $target).each(function(idx, mod) { var $mod = $(mod); moduleName = $mod.data('icingaModule'); if (icinga.hasModule(moduleName)) { - var module = icinga.module(moduleName); - // NOT YET, the applyOnloadDings: module.applyEventHandlers(mod); + icinga.module(moduleName); } }); - var searchField = $('#menu input.search', el); + var $searchField = $('#menu input.search', $target); // Remember initial search field value if any - if (searchField.length && searchField.val().length) { - self.searchValue = searchField.val(); + if ($searchField.length && $searchField.val().length) { + self.searchValue = $searchField.val(); } if (icinga.ui.isOneColLayout()) {