Keep text in the compose box when another stream/subj is clicked on

(imported from commit f063c92c4378074a7b27e45787dd1591fdde98b7)
This commit is contained in:
Jeff Arnold
2012-12-05 11:29:56 -05:00
parent c241713332
commit 8d4ddeb57d

View File

@@ -54,14 +54,17 @@ exports.start = function (msg_type, opts) {
opts = $.extend({ message_type: msg_type,
stream: '',
subject: '',
private_message_recipient: '',
message: ''
private_message_recipient: ''
}, opts);
compose.stream_name(opts.stream);
compose.subject(opts.subject);
compose.recipient(opts.private_message_recipient);
compose.message_content(opts.message);
// If the user opens the compose box, types some text, and then clicks on a
// different stream/subject, we want to keep the text in the compose box
if (opts.message !== undefined) {
compose.message_content(opts.message);
}
$('#sidebar a[href="#home"]').tab('show');
@@ -167,6 +170,7 @@ exports.hide = function () {
$('input, textarea, button').blur();
$('.message_comp').slideUp(100,
function() { $('#compose').css({visibility: "hidden"});});
compose.clear();
};
exports.clear = function () {