mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 17:36:27 +00:00
Expand the compose box in the correct mode when narrowed to PMs.
(imported from commit 68e4bb3091b855dafda8df3ca10737abb5d2f337)
This commit is contained in:
@@ -555,7 +555,11 @@ $(function () {
|
||||
$("#new_message_content").click(function (e) {
|
||||
// If we click in the composebox, start up a new message
|
||||
if (!compose.composing()) {
|
||||
if (narrow.narrowed_to_pms()) {
|
||||
compose.set_mode('private');
|
||||
} else {
|
||||
compose.set_mode('stream');
|
||||
}
|
||||
e.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -603,6 +603,19 @@ exports.by_stream_subject_uri = function (stream, subject) {
|
||||
"/subject/" + hashchange.encodeHashComponent(subject);
|
||||
};
|
||||
|
||||
exports.narrowed_to_pms = function () {
|
||||
// Are we narrowed to PMs: all PMs or PMs with particular people.
|
||||
var operators = narrow.operators();
|
||||
if (!operators) {
|
||||
return false;
|
||||
}
|
||||
if ((operators[0][0] === "pm-with") ||
|
||||
((operators[0][0] === "is") && (operators[0][1] === "private-message"))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
return exports;
|
||||
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user