Clear the compose box after successfully sending a zephyr.

You don't care about that content anymore. We probably want to clear
even more aggressively than this.

(imported from commit 29f6910a12e1b722f5801db644b04f54cf5bfd63)
This commit is contained in:
Jessica McKellar 2012-09-13 11:47:07 -04:00
parent 09b1285ac1
commit 56ea3d12d5
2 changed files with 6 additions and 1 deletions

View File

@ -73,7 +73,7 @@ var people_list = {{ people }};
</div>
<div id="bottom_whitespace"></div>
</div>
<div class="tabbable container zephyr_compose">
<div class="tabbable container zephyr_compose" id="zephyr_compose">
<ul class="nav nav-tabs" id="zephyr-type-tabs">
<li class="active"><a href="#class-message" data-toggle="tab">Stream</a></li>
<li><a href="#personal-message" data-toggle="tab">Huddle</a></li>

View File

@ -118,6 +118,7 @@ $(function () {
.text('Sent message')
.stop(true).fadeTo(0,1).delay(1000).fadeOut(1000);
buttons.removeAttr('disabled');
clear_compose_box();
},
error: function (xhr) {
var response = "Error sending message";
@ -557,6 +558,10 @@ $(function () {
get_updates_longpoll();
});
function clear_compose_box() {
$("#zephyr_compose").find('input[type=text], textarea').val('');
}
var longpoll_failures = 0;
function get_updates_longpoll() {
console.log(new Date() + ': longpoll started');