Remove inline reply forms on click-away if they have initial text as well as if empty (plus whitespace stripping)

This commit is contained in:
Brion Vibber 2011-03-10 16:10:58 -08:00
parent acca8a24b4
commit 4e1ce4e5bb
2 changed files with 4 additions and 2 deletions

View File

@ -1321,8 +1321,10 @@ var SN = { // StatusNet
// clicked outside of one...
openReplies.each(function() {
var replyItem = $(this);
var textarea = replyItem.find('.notice_data-text:first');
var cur = $.trim(textarea.val());
// Only close if there's been no edit.
if (replyItem.find('.notice_data-text:first').val() == '') {
if (cur == '' || cur == textarea.data('initialText')) {
var parentNotice = replyItem.closest('li.notice');
replyItem.remove();
SN.U.NoticeInlineReplyPlaceholder(parentNotice);

2
js/util.min.js vendored

File diff suppressed because one or more lines are too long