Extract compose.fill_in_opts_from_current_narrowed_view.

(imported from commit e89c6c7f42aa8fdfd77e879e6d9f43dd67744ea6)
This commit is contained in:
Steve Howell 2013-08-12 13:43:29 -04:00
parent 0879648f0e
commit 6314089e26
1 changed files with 14 additions and 10 deletions

View File

@ -130,15 +130,7 @@ $(function () {
}); });
}); });
exports.start = function (msg_type, opts) { function fill_in_opts_from_current_narrowed_view(msg_type, opts) {
if (reload.is_in_progress()) {
return;
}
$("#compose_close").show();
$("#compose_controls").hide();
$('.message_comp').show();
var default_opts = { var default_opts = {
message_type: msg_type, message_type: msg_type,
stream: '', stream: '',
@ -149,8 +141,20 @@ exports.start = function (msg_type, opts) {
// Set default parameters based on the current narrowed view. // Set default parameters based on the current narrowed view.
narrow.set_compose_defaults(default_opts); narrow.set_compose_defaults(default_opts);
opts = _.extend(default_opts, opts); opts = _.extend(default_opts, opts);
return opts;
}
exports.start = function (msg_type, opts) {
if (reload.is_in_progress()) {
return;
}
$("#compose_close").show();
$("#compose_controls").hide();
$('.message_comp').show();
opts = fill_in_opts_from_current_narrowed_view(msg_type, opts);
if (!(compose.composing() === msg_type && if (!(compose.composing() === msg_type &&
((msg_type === "stream" && ((msg_type === "stream" &&