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:
parent
acca8a24b4
commit
4e1ce4e5bb
@ -1321,8 +1321,10 @@ var SN = { // StatusNet
|
|||||||
// clicked outside of one...
|
// clicked outside of one...
|
||||||
openReplies.each(function() {
|
openReplies.each(function() {
|
||||||
var replyItem = $(this);
|
var replyItem = $(this);
|
||||||
|
var textarea = replyItem.find('.notice_data-text:first');
|
||||||
|
var cur = $.trim(textarea.val());
|
||||||
// Only close if there's been no edit.
|
// 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');
|
var parentNotice = replyItem.closest('li.notice');
|
||||||
replyItem.remove();
|
replyItem.remove();
|
||||||
SN.U.NoticeInlineReplyPlaceholder(parentNotice);
|
SN.U.NoticeInlineReplyPlaceholder(parentNotice);
|
||||||
|
2
js/util.min.js
vendored
2
js/util.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user