Replace compose.toggle_mode with compose.set_mode

This fixes a bug where you could click on the already-selected mode button, and
it would switch modes without changing which button is selected.

(imported from commit 263ee0b52ba844c52a3a60968bb1bbff73482412)
This commit is contained in:
Keegan McAllister
2012-11-29 14:35:24 -05:00
parent d55ccd32af
commit 1047bf49b4
2 changed files with 6 additions and 5 deletions

View File

@@ -150,9 +150,10 @@ exports.clear = function () {
$("#compose").find('input[type=text], textarea').val('');
};
exports.toggle_mode = function () {
if (compose.composing() === 'stream') {
// In stream tab, switch to private
// Set the mode of a compose already in progress.
// Does not clear the input fields.
exports.set_mode = function (mode) {
if (mode === 'private') {
show('private', $("#private_message_recipient"));
is_composing_message = "private";
} else {