mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
@@ -848,6 +848,34 @@ kit.config = kit.config || {};
|
|||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* @param {(string|string[])} deps
|
||||||
|
* @param {function} callback
|
||||||
|
* @memberOf kit
|
||||||
|
*/
|
||||||
|
|
||||||
|
PluginManager.prototype.loaded = function(deps, callback = undefined) {
|
||||||
|
var self = this;
|
||||||
|
if(typeof deps === 'function') {
|
||||||
|
callback = deps;
|
||||||
|
deps = [];
|
||||||
|
}
|
||||||
|
if(typeof callback !== 'function') {
|
||||||
|
callback = function (){};
|
||||||
|
}
|
||||||
|
self.__loaded(self.exec, [deps, callback], self);
|
||||||
|
};
|
||||||
|
PluginManager.prototype.__loaded = function(fn, args = [], context = window) {
|
||||||
|
var self = this;
|
||||||
|
context = context || this;
|
||||||
|
if (/complete|interactive|loaded/.test(document.readyState)) {
|
||||||
|
fn.apply(context, args);
|
||||||
|
} else {
|
||||||
|
window.addEventListener("load", function () {
|
||||||
|
fn.apply(context, args);
|
||||||
|
}.bind(this));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
PluginManager.prototype.require = function (pluginId, callback) {
|
PluginManager.prototype.require = function (pluginId, callback) {
|
||||||
|
|
||||||
@@ -885,6 +913,7 @@ kit.config = kit.config || {};
|
|||||||
|
|
||||||
var manager = new PluginManager(global);
|
var manager = new PluginManager(global);
|
||||||
global.ready = manager.ready.bind(manager);
|
global.ready = manager.ready.bind(manager);
|
||||||
|
global.loaded = manager.loaded.bind(manager);
|
||||||
global.exec = manager.exec.bind(manager);
|
global.exec = manager.exec.bind(manager);
|
||||||
global.require = manager.require.bind(manager);
|
global.require = manager.require.bind(manager);
|
||||||
manager.register('pluginManager', {
|
manager.register('pluginManager', {
|
||||||
@@ -932,6 +961,9 @@ kit.config = kit.config || {};
|
|||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function () {
|
||||||
console.log('%cDOMContentLoaded', 'color:#2053ff');
|
console.log('%cDOMContentLoaded', 'color:#2053ff');
|
||||||
});
|
});
|
||||||
|
window.addEventListener("load", (event) => {
|
||||||
|
console.log('%cWindowLoaded', 'color:#2053ff');
|
||||||
|
});
|
||||||
}());
|
}());
|
||||||
},
|
},
|
||||||
onInstall: function(plugin){
|
onInstall: function(plugin){
|
||||||
|
|||||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -201,7 +201,7 @@ var __PluginManagerConfigHandler__ = function() {
|
|||||||
},
|
},
|
||||||
toolkit: {
|
toolkit: {
|
||||||
path: root + '/toolkit',
|
path: root + '/toolkit',
|
||||||
module: '/toolkit.js',
|
module: '/toolkit.min.js',
|
||||||
type: 'HMD',
|
type: 'HMD',
|
||||||
css: ['/toolkit.css'],
|
css: ['/toolkit.css'],
|
||||||
deps: ['jQuery', 'mask', 'support'],
|
deps: ['jQuery', 'mask', 'support'],
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user