From 47c6c74fbf5d9c523a8d9c7ee38367f62f77a79a Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 15 Jan 2014 15:18:23 +0000 Subject: [PATCH] Never display an empty confirm message --- phpgwapi/js/egw_action/egw_action.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/phpgwapi/js/egw_action/egw_action.js b/phpgwapi/js/egw_action/egw_action.js index bc88ce1bed..daec00effc 100644 --- a/phpgwapi/js/egw_action/egw_action.js +++ b/phpgwapi/js/egw_action/egw_action.js @@ -509,7 +509,7 @@ egwAction.prototype.execute = function(_senders, _target) if (this.data && (this.data.confirm || this.data.confirm_multiple) && this.onExecute.fcnt != window.nm_action && typeof et2_dialog != 'undefined') // let old eTemplate run it's own confirmation from nextmatch_action.js { - var msg = this.data.confirm; + var msg = this.data.confirm || ''; if (_senders.length > 1) { if (this.data.confirm_multiple) msg = this.data.confirm_multiple; @@ -521,14 +521,17 @@ egwAction.prototype.execute = function(_senders, _target) } } var self = this; - et2_dialog.show_dialog(function(_button) + if(msg.trim().length > 0) { - if (_button == et2_dialog.YES_BUTTON) + et2_dialog.show_dialog(function(_button) { - return self.onExecute.exec(self, _senders, _target); - } - }, msg, self.data.hint, {}, et2_dialog.BUTTONS_YES_NO, et2_dialog.QUESTION_MESSAGE); - return; + if (_button == et2_dialog.YES_BUTTON) + { + return self.onExecute.exec(self, _senders, _target); + } + }, msg, self.data.hint, {}, et2_dialog.BUTTONS_YES_NO, et2_dialog.QUESTION_MESSAGE); + return; + } } return this.onExecute.exec(this, _senders, _target); };