Skip to content

Commit

Permalink
- Fix misleading display when chaning editor type (#1488104), fix han…
Browse files Browse the repository at this point in the history
…dling of custom commands result
  • Loading branch information
alecpl committed Sep 28, 2011
1 parent 0c1cb2f commit 14d494f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail
===========================

- Fix misleading display when chaning editor type (#1488104)
- Add loading indicator on contact delete
- Fix bug where after delete message rows can be added to the list of another folder (#1487752)
- Add notice on autocompletion that not all records were displayed
Expand Down
22 changes: 14 additions & 8 deletions program/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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) {

Expand Down Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions program/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,17 @@ function rcmail_toggle_editor(select, textAreaId, flagElement)
if (flagElement && (flag = rcube_find_object(flagElement)))
flag.value = '1';
}
else {
if (!res && select.tagName == 'SELECT')
select.value = 'html';
else if (res) {
if (flagElement && (flag = rcube_find_object(flagElement)))
flag.value = '0';

if (rcmail.env.composebody)
rcube_find_object(rcmail.env.composebody).focus();
}
else { // !res
if (select.tagName == 'SELECT')
select.value = 'html';
else if (select.tagName == 'INPUT')
select.checked = true;
}
}

0 comments on commit 14d494f

Please sign in to comment.