Always-open composebox.

Really, the "correct" way to do this is to undo "scrolltheworld", and
then just have a compose div that always lives underneath the message
list div. (This will also allow us to deal much more reasonably with
the whole "Is the composebox in focus" thing.)

In the interest of prototyping something more rapidly, though, we
adopt the somewhat more hackish approach, with the understanding that
much of it will probably be simplified later.

(imported from commit e2754be155c522b6dac28e7b84c62bd2030217c8)
This commit is contained in:
Waseem Daher
2013-05-03 16:16:52 -04:00
committed by Tim Abbott
parent 96100bb42a
commit 9384870ffa
8 changed files with 50 additions and 28 deletions

View File

@@ -213,10 +213,6 @@ exports.start = function (msg_type, opts) {
show('private', $("#" + (focus_area || 'private_message_recipient')));
}
if (message_snapshot !== undefined) {
$('#restore-draft').show();
}
if (opts.replying_to_message !== undefined) {
do_fade(opts.replying_to_message, msg_type);
}
@@ -239,6 +235,10 @@ exports.cancel = function () {
compose.hide();
abort_xhr();
is_composing_message = false;
compose.clear();
if (message_snapshot !== undefined) {
$('#restore-draft').show();
}
$(document).trigger($.Event('compose_canceled.zephyr'));
};
@@ -383,8 +383,8 @@ $(function () {
exports.hide = function () {
exports.snapshot_message();
$('.message_comp').find('input, textarea, button').blur();
$('.message_comp').slideUp(100,
function() { $('#compose').css({visibility: "hidden"});});
$('#stream-message').hide();
$('#private-message').hide();
notifications_bar.enable();
exports.unfade_messages(true);
};
@@ -540,6 +540,15 @@ exports.validate = function () {
$(function () {
$("#new_message_content").autosize();
$("#new_message_content").click(function (e) {
// If we click in the composebox, start up a new message
if (!compose.composing()) {
respond_to_message();
e.stopPropagation();
}
});
$("#compose").filedrop({
url: "json/upload_file",
fallback_id: "file_input",