Commit a1002cc1 authored by Brion Vibber's avatar Brion Vibber

Work in progress: inline reply form reusing the main reply form now inserts...

Work in progress: inline reply form reusing the main reply form now inserts the successful result more or less right
parent 97532a09
......@@ -387,7 +387,22 @@ var SN = { // StatusNet
// New notice post was successful. If on our timeline, show it!
var notice = document._importNode($('li', data)[0], true);
var notices = $('#notices_primary .notices:first');
if (notices.length > 0 && SN.U.belongsOnTimeline(notice)) {
var replyItem = form.closest('li.notice-reply');
if (replyItem.length > 0) {
// If this is an inline reply, insert it in place.
var id = $(notice).attr('id');
if ($("#"+id).length == 0) {
var parentNotice = replyItem.closest('li.notice');
replyItem.replaceWith(notice);
SN.U.NoticeInlineReplyPlaceholder(parentNotice);
} else {
// Realtime came through before us...
replyItem.remove();
}
} else if (notices.length > 0 && SN.U.belongsOnTimeline(notice)) {
// Not a reply. If on our timeline, show it at the top!
if ($('#'+notice.id).length === 0) {
var notice_irt_value = form.find('[name=inreplyto]').val();
var notice_irt = '#notices_primary #notice-'+notice_irt_value;
......@@ -406,10 +421,10 @@ var SN = { // StatusNet
SN.U.NoticeWithAttachment($('#'+notice.id));
SN.U.NoticeReplyTo($('#'+notice.id));
}
}
else {
} else {
// Not on a timeline that this belongs on?
// Just show a success message.
// @fixme inline
showFeedback('success', $('title', data).text());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment