|
|
@ -92,10 +92,6 @@ Lay.fn.use = function(apps, callback, exports){
|
|
|
|
|
|
|
|
|
|
|
|
apps = typeof apps === 'string' ? [apps] : apps;
|
|
|
|
apps = typeof apps === 'string' ? [apps] : apps;
|
|
|
|
|
|
|
|
|
|
|
|
if(!apps || apps.length === 0 || layui['layui.all']){
|
|
|
|
|
|
|
|
return typeof callback === 'function' && callback.apply(layui, exports), that;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//如果页面已经存在jQuery1.7+库且所定义的模块依赖jQuery,则不加载内部jquery模块
|
|
|
|
//如果页面已经存在jQuery1.7+库且所定义的模块依赖jQuery,则不加载内部jquery模块
|
|
|
|
if(window.jQuery && jQuery.fn.on){
|
|
|
|
if(window.jQuery && jQuery.fn.on){
|
|
|
|
that.each(apps, function(index, item){
|
|
|
|
that.each(apps, function(index, item){
|
|
|
@ -112,6 +108,10 @@ Lay.fn.use = function(apps, callback, exports){
|
|
|
|
//静态资源host
|
|
|
|
//静态资源host
|
|
|
|
config.host = config.host || (dir.match(/\/\/([\s\S]+?)\//)||['//'+ location.host +'/'])[0];
|
|
|
|
config.host = config.host || (dir.match(/\/\/([\s\S]+?)\//)||['//'+ location.host +'/'])[0];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(apps.length === 0 || layui['layui.all']){
|
|
|
|
|
|
|
|
return typeof callback === 'function' && callback.apply(layui, exports), that;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//加载完毕
|
|
|
|
//加载完毕
|
|
|
|
function onScriptLoad(e, url){
|
|
|
|
function onScriptLoad(e, url){
|
|
|
|
var readyRegExp = navigator.platform === 'PLaySTATION 3' ? /^complete$/ : /^(complete|loaded)$/
|
|
|
|
var readyRegExp = navigator.platform === 'PLaySTATION 3' ? /^complete$/ : /^(complete|loaded)$/
|
|
|
|