form_notice textarea is cleared on successful direct message post.
Disabled notice posting with XHR on Inbox and Outbox pages. This will be revisited in 0.8.x.
This commit is contained in:
parent
ed05569716
commit
c3a44d2ab9
14
js/util.js
14
js/util.js
|
@ -166,28 +166,36 @@ $(document).ready(function(){
|
||||||
$("#notice_action-submit").addClass("disabled");
|
$("#notice_action-submit").addClass("disabled");
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
success: function(xml) { if ($("#error", xml).length > 0 || $("#command_result", xml).length > 0) {
|
success: function(xml) { if ($("#error", xml).length > 0) {
|
||||||
|
var result = document._importNode($("p", xml).get(0), true);
|
||||||
|
result = result.textContent || result.innerHTML;
|
||||||
|
alert(result);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if ($("#command_result", xml).length > 0) {
|
||||||
var result = document._importNode($("p", xml).get(0), true);
|
var result = document._importNode($("p", xml).get(0), true);
|
||||||
result = result.textContent || result.innerHTML;
|
result = result.textContent || result.innerHTML;
|
||||||
alert(result);
|
alert(result);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true));
|
$("#notices_primary .notices").prepend(document._importNode($("li", xml).get(0), true));
|
||||||
$("#notice_data-text").val("");
|
|
||||||
counter();
|
counter();
|
||||||
$("#notices_primary .notice:first").css({display:"none"});
|
$("#notices_primary .notice:first").css({display:"none"});
|
||||||
$("#notices_primary .notice:first").fadeIn(2500);
|
$("#notices_primary .notice:first").fadeIn(2500);
|
||||||
NoticeHover();
|
NoticeHover();
|
||||||
NoticeReply();
|
NoticeReply();
|
||||||
}
|
}
|
||||||
|
$("#notice_data-text").val("");
|
||||||
|
}
|
||||||
$("#form_notice").removeClass("processing");
|
$("#form_notice").removeClass("processing");
|
||||||
$("#notice_action-submit").removeAttr("disabled");
|
$("#notice_action-submit").removeAttr("disabled");
|
||||||
$("#notice_action-submit").removeClass("disabled");
|
$("#notice_action-submit").removeClass("disabled");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if (document.body.id != 'inbox' && document.body.id != 'outbox') {
|
||||||
$("#form_notice").ajaxForm(PostNotice);
|
$("#form_notice").ajaxForm(PostNotice);
|
||||||
$("#form_notice").each(addAjaxHidden);
|
$("#form_notice").each(addAjaxHidden);
|
||||||
|
}
|
||||||
NoticeHover();
|
NoticeHover();
|
||||||
NoticeReply();
|
NoticeReply();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user