mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 11:52:01 +00:00
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:
@@ -101,12 +101,12 @@
|
||||
<div id="stream_or_huddle">
|
||||
<ul class="nav nav-pills nav-stacked" id="message-type-tabs">
|
||||
<li class="active" id="stream_toggle">
|
||||
<a href="#stream-message" data-toggle="pill" title="Send a stream message" tabindex="100" onclick="compose.toggle_mode();">
|
||||
<a href="#stream-message" data-toggle="pill" title="Send a stream message" tabindex="100" onclick="compose.set_mode('stream');">
|
||||
<i class="icon-bullhorn"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li id="private_message_toggle">
|
||||
<a href="#private-message" data-toggle="pill" title="Send a private message" tabindex="110" onclick="compose.toggle_mode();">
|
||||
<a href="#private-message" data-toggle="pill" title="Send a private message" tabindex="110" onclick="compose.set_mode('private');">
|
||||
<i class="icon-user"></i>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user