From a8782f4dc89014ecb5f00a22167adf95c8526f84 Mon Sep 17 00:00:00 2001 From: Marcin Haba Date: Sun, 13 Dec 2015 21:51:04 +0100 Subject: [PATCH] baculum: Do not refresh window lists if toolbar is open or elements are checked --- .../protected/JavaScript/slide-window.js | 20 +++++++++++++------ .../Portlets/ClientConfiguration.tpl | 7 +++++++ .../protected/Portlets/JobConfiguration.tpl | 17 +++++++++------- .../Portlets/JobRunConfiguration.tpl | 7 +++++++ .../protected/Portlets/PoolConfiguration.tpl | 7 +++++++ .../Portlets/VolumeConfiguration.tpl | 11 +++++++++- 6 files changed, 55 insertions(+), 14 deletions(-) diff --git a/gui/baculum/protected/JavaScript/slide-window.js b/gui/baculum/protected/JavaScript/slide-window.js index d0d329c02d..cbb7c63c8f 100644 --- a/gui/baculum/protected/JavaScript/slide-window.js +++ b/gui/baculum/protected/JavaScript/slide-window.js @@ -405,11 +405,10 @@ var SlideWindowClass = Class.create({ return $(this.windowId + this.elements.toolbarSuffix).visible(); }, setActions: function() { - var table = $(this.window).down('table'); - var checkboxes = table.select('input[name="actions_checkbox"]'); + var checkboxes = this.getCheckboxes(); checkboxes.each(function(el) { el.observe('change', function() { - var is_checked = this.is_any_checked(checkboxes); + var is_checked = this.isAnyChecked(checkboxes); if(is_checked === true && !this.areActionsOpen()) { this.showActions(); } else if (is_checked === false && this.areActionsOpen()) { @@ -418,7 +417,7 @@ var SlideWindowClass = Class.create({ }.bind(this)); }.bind(this)); }, - is_any_checked: function(checkboxes) { + isAnyChecked: function(checkboxes) { var is_checked = false; checkboxes.each(function(ch) { if(ch.checked == true) { @@ -429,10 +428,19 @@ var SlideWindowClass = Class.create({ return is_checked; }, + getCheckboxes: function() { + var checkboxes = $(this.gridEl).select('input[name="actions_checkbox"]'); + return checkboxes; + }, + + areCheckboxesChecked: function() { + var checkboxes = this.getCheckboxes(); + return this.isAnyChecked(checkboxes); + }, + markAllChecked: function(check) { this.checked = []; - var table = $(this.window).down('table'); - var checkboxes = table.select('input[name="actions_checkbox"]'); + var checkboxes = this.getCheckboxes(); var containerId; if(checkboxes.length > 0) { checkboxes.each(function(ch, index) { diff --git a/gui/baculum/protected/Portlets/ClientConfiguration.tpl b/gui/baculum/protected/Portlets/ClientConfiguration.tpl index 9e480b55fe..fd13e84479 100644 --- a/gui/baculum/protected/Portlets/ClientConfiguration.tpl +++ b/gui/baculum/protected/Portlets/ClientConfiguration.tpl @@ -35,6 +35,13 @@ diff --git a/gui/baculum/protected/Portlets/JobRunConfiguration.tpl b/gui/baculum/protected/Portlets/JobRunConfiguration.tpl index 1fecd5e396..01c86e3e41 100644 --- a/gui/baculum/protected/Portlets/JobRunConfiguration.tpl +++ b/gui/baculum/protected/Portlets/JobRunConfiguration.tpl @@ -121,6 +121,13 @@