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