From 68a90b8de839f2afd33081d72bd19f6832010d7b Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 20 Jun 2014 13:33:19 +0200 Subject: [PATCH] JS/ui: separate closeContainer logic --- public/js/icinga/ui.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/public/js/icinga/ui.js b/public/js/icinga/ui.js index cca166126..cc6ae5c5e 100644 --- a/public/js/icinga/ui.js +++ b/public/js/icinga/ui.js @@ -214,15 +214,18 @@ layout1col: function () { if (! $('#layout').hasClass('twocols')) { return; } - var $col2 = $('#col2'); this.icinga.logger.debug('Switching to single col'); $('#layout').removeClass('twocols'); - $col2.removeData('icingaUrl'); - $col2.removeData('icingaRefresh'); - $col2.removeData('lastUpdate'); - $col2.removeData('icingaModule'); - this.icinga.loader.stopPendingRequestsFor($col2); - $col2.html(''); + this.closeContainer($('#col2')); + }, + + closeContainer: function($c) { + $c.removeData('icingaUrl'); + $c.removeData('icingaRefresh'); + $c.removeData('lastUpdate'); + $c.removeData('icingaModule'); + this.icinga.loader.stopPendingRequestsFor($c); + $c.html(''); this.fixControls(); },