Shorten tree-specific event handler
This commit is contained in:
parent
ebbd4119c2
commit
a8cecfa162
|
@ -94,12 +94,18 @@
|
||||||
$(document).on('mouseenter', '.historycolorgrid td', this.historycolorgridHover);
|
$(document).on('mouseenter', '.historycolorgrid td', this.historycolorgridHover);
|
||||||
$(document).on('mouseleave', '.historycolorgrid td', this.historycolorgidUnhover);
|
$(document).on('mouseleave', '.historycolorgrid td', this.historycolorgidUnhover);
|
||||||
|
|
||||||
|
$(document).on('click', '.tree .handle', { self: this }, this.treeNodeToggle);
|
||||||
|
|
||||||
// TBD: a global autocompletion handler
|
// TBD: a global autocompletion handler
|
||||||
// $(document).on('keyup', 'form.auto input', this.formChangeDelayed);
|
// $(document).on('keyup', 'form.auto input', this.formChangeDelayed);
|
||||||
// $(document).on('change', 'form.auto input', this.formChanged);
|
// $(document).on('change', 'form.auto input', this.formChanged);
|
||||||
// $(document).on('change', 'form.auto select', this.submitForm);
|
// $(document).on('change', 'form.auto select', this.submitForm);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
treeNodeToggle: function (event) {
|
||||||
|
$(this).closest('li').toggleClass('collapsed');
|
||||||
|
},
|
||||||
|
|
||||||
onUnload: function (event) {
|
onUnload: function (event) {
|
||||||
var icinga = event.data.self.icinga;
|
var icinga = event.data.self.icinga;
|
||||||
icinga.logger.info('Unloading Icinga');
|
icinga.logger.info('Unloading Icinga');
|
||||||
|
@ -198,24 +204,6 @@
|
||||||
|
|
||||||
$target = self.getLinkTargetFor($a);
|
$target = self.getLinkTargetFor($a);
|
||||||
|
|
||||||
// Tree handler
|
|
||||||
// TODO: We should move this somewhere else and "register" such
|
|
||||||
// handlers
|
|
||||||
if ($a.closest('.tree').length) {
|
|
||||||
$li = $a.closest('li');
|
|
||||||
if ($li.find('li').length) {
|
|
||||||
if ($li.hasClass('collapsed')) {
|
|
||||||
$li.removeClass('collapsed');
|
|
||||||
} else {
|
|
||||||
$li.addClass('collapsed');
|
|
||||||
$li.find('li').addClass('collapsed');
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
$target = $('#col2');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load link URL
|
// Load link URL
|
||||||
icinga.loader.loadUrl(href, $target);
|
icinga.loader.loadUrl(href, $target);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue