forked from leftypol/leftypol
Fix for ajax posting not showing you your new post
- TODO: there are console.logs that still need to be removed - Posting was loading the new page twice - once in ajax.js and once in auto-reload.js. auto-reload will handle this behaviour, the other is commented out - The new post does not immediately show up when immediately ajax requesting the page after posting completes. Adding an epoch query parameter did not change this. Instead of figuring out why it was easier to add a 500ms delay before requesting the page, now it seems to work well.
This commit is contained in:
parent
b256157c40
commit
454ad4381a
2 changed files with 27 additions and 2 deletions
|
@ -79,6 +79,8 @@ $(window).ready(function() {
|
|||
|| (!settings.get('always_noko_replies', true) && !post_response.noko)) {
|
||||
document.location = post_response.redirect;
|
||||
} else {
|
||||
console.log("do nothing for now, this behaviour will be handled by auto-reload.js");
|
||||
/*
|
||||
$.ajax({
|
||||
url: document.location,
|
||||
success: function(data) {
|
||||
|
@ -105,9 +107,14 @@ $(window).ready(function() {
|
|||
contentType: false,
|
||||
processData: false
|
||||
}, 'html');
|
||||
*/
|
||||
}
|
||||
$(form).find('input[type="submit"]').val(_('Posted...'));
|
||||
$(document).trigger("ajax_after_post", post_response);
|
||||
$(form).find('input[type="submit"]').val(submit_txt);
|
||||
$(form).find('input[type="submit"]').removeAttr('disabled');
|
||||
$(form).find('input[name="subject"],input[name="file_url"],\
|
||||
textarea[name="body"],input[type="file"]').val('').change();
|
||||
} else {
|
||||
alert(_('An unknown error occured when posting!'));
|
||||
$(form).find('input[type="submit"]').val(submit_txt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue