mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
fixed issue where calls to ajaxify.go were sending in a "template" argument that had since been removed, navigating back to NodeBB from an external link now no longer clobbers the History stack.
This commit is contained in:
@@ -23,7 +23,6 @@ var ajaxify = {};
|
|||||||
|
|
||||||
|
|
||||||
window.onpopstate = function (event) {
|
window.onpopstate = function (event) {
|
||||||
// "quiet": If set to true, will not call pushState
|
|
||||||
if (event !== null && event.state && event.state.url !== undefined) {
|
if (event !== null && event.state && event.state.url !== undefined) {
|
||||||
ajaxify.go(event.state.url, null, true);
|
ajaxify.go(event.state.url, null, true);
|
||||||
}
|
}
|
||||||
@@ -34,6 +33,8 @@ var ajaxify = {};
|
|||||||
ajaxify.currentPage = null;
|
ajaxify.currentPage = null;
|
||||||
|
|
||||||
ajaxify.go = function (url, callback, quiet) {
|
ajaxify.go = function (url, callback, quiet) {
|
||||||
|
// "quiet": If set to true, will not call pushState
|
||||||
|
|
||||||
// start: the following should be set like so: ajaxify.onchange(function(){}); where the code actually belongs
|
// start: the following should be set like so: ajaxify.onchange(function(){}); where the code actually belongs
|
||||||
$(window).off('scroll');
|
$(window).off('scroll');
|
||||||
app.enterRoom('global');
|
app.enterRoom('global');
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ if(nconf.get('ssl')) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
app.create_route = function (url, tpl) { // to remove
|
app.create_route = function (url, tpl) { // to remove
|
||||||
return '<script>templates.ready(function(){ajaxify.go("' + url + '", null, "' + tpl + '", true);});</script>';
|
return '<script>templates.ready(function(){ajaxify.go("' + url + '", null, true);});</script>';
|
||||||
};
|
};
|
||||||
|
|
||||||
app.namespace(nconf.get('relative_path'), function () {
|
app.namespace(nconf.get('relative_path'), function () {
|
||||||
@@ -648,7 +648,7 @@ if(nconf.get('ssl')) {
|
|||||||
res.send(
|
res.send(
|
||||||
data.header +
|
data.header +
|
||||||
'\n\t<noscript>\n' + templates['noscript/header'] + templates['noscript/topic'].parse(data.topics) + '\n\t</noscript>' +
|
'\n\t<noscript>\n' + templates['noscript/header'] + templates['noscript/topic'].parse(data.topics) + '\n\t</noscript>' +
|
||||||
'\n\t<script>templates.ready(function(){ajaxify.go("topic/' + topic_url + '", undefined, undefined, true);});</script>' +
|
'\n\t<script>templates.ready(function(){ajaxify.go("topic/' + topic_url + '", undefined, true);});</script>' +
|
||||||
templates.footer
|
templates.footer
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -763,7 +763,7 @@ if(nconf.get('ssl')) {
|
|||||||
res.send(
|
res.send(
|
||||||
data.header +
|
data.header +
|
||||||
'\n\t<noscript>\n' + templates['noscript/header'] + templates['noscript/category'].parse(data.categories) + '\n\t</noscript>' +
|
'\n\t<noscript>\n' + templates['noscript/header'] + templates['noscript/category'].parse(data.categories) + '\n\t</noscript>' +
|
||||||
'\n\t<script>templates.ready(function(){ajaxify.go("category/' + category_url + '", undefined, undefined, true);});</script>' +
|
'\n\t<script>templates.ready(function(){ajaxify.go("category/' + category_url + '", undefined, true);});</script>' +
|
||||||
templates.footer
|
templates.footer
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -774,7 +774,7 @@ if(nconf.get('ssl')) {
|
|||||||
req: req,
|
req: req,
|
||||||
res: res
|
res: res
|
||||||
}, function (err, header) {
|
}, function (err, header) {
|
||||||
res.send(header + '<script>templates.ready(function(){ajaxify.go("confirm/' + req.params.code + '", undefined, undefined, true);});</script>' + templates.footer);
|
res.send(header + '<script>templates.ready(function(){ajaxify.go("confirm/' + req.params.code + '", undefined, true);});</script>' + templates.footer);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -847,7 +847,7 @@ if(nconf.get('ssl')) {
|
|||||||
}, function (err, header) {
|
}, function (err, header) {
|
||||||
res.send(
|
res.send(
|
||||||
header +
|
header +
|
||||||
'\n\t<script>templates.ready(function(){ajaxify.go("outgoing?url=' + encodeURIComponent(req.query.url) + '", null, null, true);});</script>' +
|
'\n\t<script>templates.ready(function(){ajaxify.go("outgoing?url=' + encodeURIComponent(req.query.url) + '", null, true);});</script>' +
|
||||||
templates.footer
|
templates.footer
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user