altering ajaxify abort behaviour to look for null instead of empty string, and triggering ajaxify.end when abort occurs

v1.18.x
Julian Lam 9 years ago
parent 9e7d90e314
commit e019eb40c4

@ -67,7 +67,8 @@ $(document).ready(function() {
url = ajaxify.start(url);
// If any listeners alter url and set it to an empty string, abort the ajaxification
if (url === '') {
if (url === null) {
$(window).trigger('action:ajaxify.end', {url: url, tpl_url: ajaxify.data.template.name, title: ajaxify.data.title});
return false;
}

@ -50,10 +50,12 @@ define('forum/footer', ['notifications', 'chat', 'components', 'translator'], fu
}
$(window).on('action:ajaxify.end', function(ev, data) {
var tid = data.url.match(/^topic\/(\d+)/);
if (data.url) {
var tid = data.url.match(/^topic\/(\d+)/);
if (tid && tid[1]) {
delete unreadTopics[tid[1]];
if (tid && tid[1]) {
delete unreadTopics[tid[1]];
}
}
});

@ -31,7 +31,7 @@ define('forum/topic', [
$(window).off('keydown', onKeyDown);
}
if (!data.url.startsWith('topic/')) {
if (data.url && !data.url.startsWith('topic/')) {
require(['search'], function(search) {
if (search.topicDOM.active) {
search.topicDOM.end();

Loading…
Cancel
Save