mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 23:15:48 +01:00
ajaxify.loadScript
This commit is contained in:
@@ -86,12 +86,7 @@ var ajaxify = {};
|
|||||||
|
|
||||||
templates.flush();
|
templates.flush();
|
||||||
templates.load_template(function () {
|
templates.load_template(function () {
|
||||||
|
ajaxify.loadScript(tpl_url);
|
||||||
require(['forum/' + tpl_url], function(script) {
|
|
||||||
if (script && script.init) {
|
|
||||||
script.init();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (typeof callback === 'function') {
|
if (typeof callback === 'function') {
|
||||||
callback();
|
callback();
|
||||||
@@ -114,6 +109,18 @@ var ajaxify = {};
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ajaxify.loadScript = function(tpl_url, callback) {
|
||||||
|
require(['forum/' + tpl_url], function(script) {
|
||||||
|
if (script && script.init) {
|
||||||
|
script.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (callback) {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
ajaxify.fadeIn = function() {
|
ajaxify.fadeIn = function() {
|
||||||
$('#content, #footer').stop(true, true).removeClass('ajaxifying');
|
$('#content, #footer').stop(true, true).removeClass('ajaxifying');
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user