mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-06 15:42:52 +01:00
closes #3568
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
var dataEl = $('#content [ajaxify-data]');
|
||||
if (dataEl.length) {
|
||||
ajaxify.data = JSON.parse(decodeURIComponent(dataEl.attr('ajaxify-data')));
|
||||
dataEl.remove();
|
||||
}
|
||||
};
|
||||
}(ajaxify || {}));
|
||||
|
||||
@@ -320,7 +320,6 @@ middleware.processRender = function(req, res, next) {
|
||||
|
||||
self.send(str);
|
||||
};
|
||||
|
||||
options = options || {};
|
||||
|
||||
if ('function' === typeof options) {
|
||||
@@ -346,13 +345,14 @@ middleware.processRender = function(req, res, next) {
|
||||
return res.json(options);
|
||||
}
|
||||
|
||||
var ajaxifyData = encodeURIComponent(JSON.stringify(options));
|
||||
render.call(self, template, options, function(err, str) {
|
||||
if (err) {
|
||||
winston.error(err);
|
||||
return fn(err);
|
||||
}
|
||||
|
||||
str = str + '<input type="hidden" ajaxify-data="' + encodeURIComponent(JSON.stringify(options)) + '" />';
|
||||
str = str + '<input type="hidden" ajaxify-data="' + ajaxifyData + '" />';
|
||||
str = (res.locals.postHeader ? res.locals.postHeader : '') + str + (res.locals.preFooter ? res.locals.preFooter : '');
|
||||
|
||||
if (res.locals.footer) {
|
||||
|
||||
Reference in New Issue
Block a user