diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-09-28 09:00:25 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-09-28 09:00:25 +0000 |
| commit | efab1199bbb43321ee273a927da417910739a1df (patch) | |
| tree | 5e9a53e1bfed9f2b4e90f5e34627772b78d6c66f /roundcubemail/program/js/app.js | |
| parent | f1c90701944e9fd9b705f2673f46f987dbffc678 (diff) | |
- Fix misleading display when chaning editor type (#1488104), fix handling of custom commands result
git-svn-id: https://svn.roundcube.net/trunk@5283 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/js/app.js')
| -rw-r--r-- | roundcubemail/program/js/app.js | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js index a2092563f..22599ebf0 100644 --- a/roundcubemail/program/js/app.js +++ b/roundcubemail/program/js/app.js @@ -439,6 +439,8 @@ function rcube_webmail() // execute a specific command on the web client this.command = function(command, props, obj) { + var ret; + if (obj && obj.blur) obj.blur(); @@ -462,25 +464,27 @@ function rcube_webmail() // process external commands if (typeof this.command_handlers[command] === 'function') { - var ret = this.command_handlers[command](props, obj); + ret = this.command_handlers[command](props, obj); return ret !== undefined ? ret : (obj ? false : true); } else if (typeof this.command_handlers[command] === 'string') { - var ret = window[this.command_handlers[command]](props, obj); + ret = window[this.command_handlers[command]](props, obj); return ret !== undefined ? ret : (obj ? false : true); } // trigger plugin hooks this.triggerEvent('actionbefore', {props:props, action:command}); - var ret = this.triggerEvent('before'+command, props); + ret = this.triggerEvent('before'+command, props); if (ret !== undefined) { - // abort if one the handlers returned false + // abort if one of the handlers returned false if (ret === false) return false; else props = ret; } + ret = undefined; + // process internal command switch (command) { @@ -1045,15 +1049,17 @@ function rcube_webmail() // unified command call (command name == function name) default: var func = command.replace(/-/g, '_'); - if (this[func] && typeof this[func] === 'function') - this[func](props); + if (this[func] && typeof this[func] === 'function') { + ret = this[func](props); + } break; } - this.triggerEvent('after'+command, props); + if (this.triggerEvent('after'+command, props) === false) + ret = false; this.triggerEvent('actionafter', {props:props, action:command}); - return obj ? false : true; + return ret === false ? false : obj ? false : true; }; // set command(s) enabled or disabled |
