If an XHR notice is sent form a page that has no timeline, show a
message like 'Notice sent'
This commit is contained in:
parent
62d5f05669
commit
ad8d6c8fbf
12
js/util.js
12
js/util.js
@ -220,7 +220,9 @@ var SN = { // StatusNet
|
||||
form.append('<p class="success">'+result+'</p>');
|
||||
}
|
||||
else {
|
||||
notice = document._importNode($('li', data)[0], true);
|
||||
var notices = $('#notices_primary .notices');
|
||||
if (notices.length > 0) {
|
||||
var notice = document._importNode($('li', data)[0], true);
|
||||
if ($('#'+notice.id).length === 0) {
|
||||
var notice_irt_value = $('#'+SN.C.S.NoticeInReplyTo).val();
|
||||
var notice_irt = '#notices_primary #notice-'+notice_irt_value;
|
||||
@ -231,7 +233,7 @@ var SN = { // StatusNet
|
||||
$($(notice_irt+' .notices')[0]).append(notice);
|
||||
}
|
||||
else {
|
||||
$("#notices_primary .notices").prepend(notice);
|
||||
notices.prepend(notice);
|
||||
}
|
||||
$('#'+notice.id).css({display:'none'});
|
||||
$('#'+notice.id).fadeIn(2500);
|
||||
@ -240,6 +242,12 @@ var SN = { // StatusNet
|
||||
SN.U.FormXHR($('#'+notice.id+' .form_favor'));
|
||||
}
|
||||
}
|
||||
else {
|
||||
result = document._importNode($('title', data)[0], true);
|
||||
result_title = result.textContent || result.innerHTML;
|
||||
form.append('<p class="success">'+result_title+'</p>');
|
||||
}
|
||||
}
|
||||
$('#'+form_id+' #'+SN.C.S.NoticeDataText).val('');
|
||||
$('#'+form_id+' #'+SN.C.S.NoticeDataAttach).val('');
|
||||
$('#'+form_id+' #'+SN.C.S.NoticeInReplyTo).val('');
|
||||
|
Loading…
Reference in New Issue
Block a user