Skip to content

Commit

Permalink
Fix bug where Encrypt button appears when switching editor to HTML (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed May 1, 2016
1 parent 5194120 commit 667ed37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CHANGELOG Roundcube Webmail
- Fix bug where getting HTML editor content could steal focus from other form controls (#5223)
- Fix bug where contact search menu fields where always unchecked in Larry skin
- Fix autoloading of 'html' class
- Fix bug where Encrypt button appears when switching editor to HTML (#5235)

RELEASE 1.2-rc
--------------
Expand Down
10 changes: 7 additions & 3 deletions program/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ function rcube_webmail()

if (!aborted && this.triggerEvent('after'+command, props) === false)
ret = false;
this.triggerEvent('actionafter', { props:props, action:command, aborted:aborted });
this.triggerEvent('actionafter', { props:props, action:command, aborted:aborted, ret:ret });

return ret === false ? false : obj ? false : true;
};
Expand Down Expand Up @@ -3477,6 +3477,12 @@ function rcube_webmail()
// enable encrypted compose toggle
this.enable_command('compose-encrypted', !is_html);
}

// make sure to disable encryption button after toggling editor into HTML mode
this.addEventListener('actionafter', function(args) {
if (args.ret && args.action == 'toggle-editor')
ref.enable_command('compose-encrypted', !args.props.html);
});
}
};

Expand Down Expand Up @@ -4294,8 +4300,6 @@ function rcube_webmail()
if (result) {
// update internal format flag
$("input[name='_is_html']").val(props.html ? 1 : 0);
// enable encrypted compose toggle
this.enable_command('compose-encrypted', !props.html);
}

return result;
Expand Down

0 comments on commit 667ed37

Please sign in to comment.