From 5c290e1b681a26383bbf919c68b501fc3949545b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 17 Jul 2019 12:45:56 +0200 Subject: [PATCH] collapsible.js: Rename event callbacks `onExternalCollapse` => `onCollapse` `onExternalExpansion` => `onExpand` --- public/js/icinga/behavior/collapsible.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/public/js/icinga/behavior/collapsible.js b/public/js/icinga/behavior/collapsible.js index 5c07edfff..080e8beff 100644 --- a/public/js/icinga/behavior/collapsible.js +++ b/public/js/icinga/behavior/collapsible.js @@ -26,9 +26,10 @@ Icinga.Storage.BehaviorStorage('collapsible'), 'expanded' ) - .on('add', this.onExternalExpansion, this) - .on('delete', this.onExternalCollapse, this); + .on('add', this.onExpand, this) + .on('delete', this.onCollapse, this); }; + Collapsible.prototype = new Icinga.EventListener(); /** @@ -87,10 +88,9 @@ /** * A collapsible got expanded in another window, try to apply this here as well * - * @param {Event} event * @param {string} collapsiblePath */ - Collapsible.prototype.onExternalExpansion = function(collapsiblePath) { + Collapsible.prototype.onExpand = function(collapsiblePath) { var $collapsible = $(collapsiblePath); if ($collapsible.length && $collapsible.is('.can-collapse')) { @@ -101,10 +101,9 @@ /** * A collapsible got collapsed in another window, try to apply this here as well * - * @param {Event} event * @param {string} collapsiblePath */ - Collapsible.prototype.onExternalCollapse = function(collapsiblePath) { + Collapsible.prototype.onCollapse = function(collapsiblePath) { var $collapsible = $(collapsiblePath); if ($collapsible.length && this.canCollapse($collapsible)) { @@ -165,8 +164,8 @@ if (!! rowSelector) { return $(rowSelector, $collapsible).length > ($collapsible.data('visibleRows') || this.defaultVisibleRows); } else { - var actualHeight = $collapsible[0].scrollHeight, - maxHeight = $collapsible.data('visibleHeight') || this.defaultVisibleHeight; + var actualHeight = $collapsible[0].scrollHeight; + var maxHeight = $collapsible.data('visibleHeight') || this.defaultVisibleHeight; if (actualHeight <= maxHeight) { return false;