Take care of module JS respecting recent module container changes

* Also improves generic tree behaviour
This commit is contained in:
Thomas Gelf 2014-03-20 09:58:28 +00:00
parent 3059228378
commit 9561096f4a
1 changed files with 16 additions and 2 deletions

View File

@ -42,9 +42,17 @@
}
});
var moduleName
if (moduleName = el.data('icingaModule')) {
if (icinga.hasModule(moduleName)) {
var module = icinga.module(moduleName);
// NOT YET, the applyOnloadDings: module.applyEventHandlers(mod);
}
}
$('.icinga-module', el).each(function(idx, mod) {
var $mod = $(mod);
var moduleName = $mod.data('icingaModule');
moduleName = $mod.data('icingaModule');
if (icinga.hasModule(moduleName)) {
var module = icinga.module(moduleName);
// NOT YET, the applyOnloadDings: module.applyEventHandlers(mod);
@ -103,7 +111,13 @@
},
treeNodeToggle: function (event) {
$(this).closest('li').toggleClass('collapsed');
var $parent = $(this).closest('li');
if ($parent.hasClass('collapsed')) {
$('li', $parent).addClass('collapsed');
$parent.removeClass('collapsed');
} else {
$parent.addClass('collapsed');
}
},
onUnload: function (event) {