Clear the composebox on open instead of close

Variables like stream, subject, and message were getting cleared from the DOM
when the compose box was closed. The "Create and send" button was trying to
access these variables to create a new stream, but they were gone. Now they
are cleared when a new compose is started.

Fixes trac ticket #568.

(imported from commit 39ccaaeacb3f92f4b1d771be1b34ff660e0d5883)
This commit is contained in:
Tyler Hallada
2012-12-18 15:28:28 -05:00
parent d75053f124
commit d179de07f6

View File

@@ -56,6 +56,8 @@ exports.start = function (msg_type, opts) {
return;
}
compose.clear();
opts = $.extend({ message_type: msg_type,
stream: '',
subject: '',
@@ -175,7 +177,6 @@ exports.hide = function () {
$('input, textarea, button').blur();
$('.message_comp').slideUp(100,
function() { $('#compose').css({visibility: "hidden"});});
compose.clear();
};
exports.clear = function () {