mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 15:35:47 +01:00
fixing back button behaviour and playing nice with History API
This commit is contained in:
@@ -67,26 +67,24 @@ var ajaxify = {};
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (templates.is_available(tpl_url) && !templates.force_refresh(tpl_url)) {
|
if (templates.is_available(tpl_url) && !templates.force_refresh(tpl_url)) {
|
||||||
//if (quiet !== true) {
|
if (window.history && window.history.pushState) {
|
||||||
if (window.history && window.history.pushState) {
|
window.history[!quiet ? 'pushState' : 'replaceState']({
|
||||||
window.history.pushState({
|
url: url
|
||||||
url: url
|
}, url, RELATIVE_PATH + '/' + url);
|
||||||
}, url, RELATIVE_PATH + '/' + url);
|
|
||||||
|
|
||||||
$.ajax(RELATIVE_PATH + '/plugins/fireHook', {
|
$.ajax(RELATIVE_PATH + '/plugins/fireHook', {
|
||||||
type: 'PUT',
|
type: 'PUT',
|
||||||
data: {
|
data: {
|
||||||
_csrf: $('#csrf_token').val(),
|
_csrf: $('#csrf_token').val(),
|
||||||
hook: 'page.load',
|
hook: 'page.load',
|
||||||
args: {
|
args: {
|
||||||
template: tpl_url,
|
template: tpl_url,
|
||||||
url: url,
|
url: url,
|
||||||
uid: app.uid
|
uid: app.uid
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
}
|
});
|
||||||
//}
|
}
|
||||||
|
|
||||||
translator.load(tpl_url);
|
translator.load(tpl_url);
|
||||||
|
|
||||||
@@ -114,7 +112,7 @@ var ajaxify = {};
|
|||||||
|
|
||||||
if (hash) {
|
if (hash) {
|
||||||
require(['forum/topic'], function(topic) {
|
require(['forum/topic'], function(topic) {
|
||||||
topic.scrollToPost(hash.substr(1))
|
topic.scrollToPost(hash.substr(1));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user