Hide the 'Send' button when Enter sends.

Like Facebook does.

Fixes Trac #1019.

(imported from commit 62bd35026ed532d5cb35be9bef5eecd5f63b34de)
This commit is contained in:
Waseem Daher 2013-02-28 00:00:27 -05:00
parent dcba1e3f46
commit 6cceda503f
1 changed files with 7 additions and 0 deletions

View File

@ -150,7 +150,13 @@ exports.initialize = function () {
});
$("#enter_sends").click(function () {
var send_button = $("#compose-send-button");
enter_sends = $("#enter_sends").is(":checked");
if (enter_sends) {
send_button.fadeOut();
} else {
send_button.fadeIn();
}
return $.ajax({
dataType: 'json',
url: '/json/change_enter_sends',
@ -159,6 +165,7 @@ exports.initialize = function () {
});
});
$("#enter_sends").prop('checked', enter_sends);
if (enter_sends) $("#compose-send-button").hide();
// limit number of items so the list doesn't fall off the screen
$( "#stream" ).typeahead({