return the jQuery deferred object when using OC.loadScript
This commit is contained in:
parent
d786194ddc
commit
92c782c1b0
|
@ -120,18 +120,19 @@ OC={
|
||||||
*/
|
*/
|
||||||
addScript:function(app,script,ready){
|
addScript:function(app,script,ready){
|
||||||
var path=OC.filePath(app,'js',script+'.js');
|
var path=OC.filePath(app,'js',script+'.js');
|
||||||
if(OC.addScript.loaded.indexOf(path)==-1){
|
if(!OC.addScript.loaded[path]){
|
||||||
OC.addScript.loaded.push(path);
|
|
||||||
if(ready){
|
if(ready){
|
||||||
$.getScript(path,ready);
|
var deferred=$.getScript(path,ready);
|
||||||
}else{
|
}else{
|
||||||
$.getScript(path);
|
var deferred=$.getScript(path);
|
||||||
}
|
}
|
||||||
|
OC.addScript.loaded[path]=deferred;
|
||||||
}else{
|
}else{
|
||||||
if(ready){
|
if(ready){
|
||||||
ready();
|
ready();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return OC.addScript.loaded[path];
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* load a css file and load it
|
* load a css file and load it
|
||||||
|
|
Loading…
Reference in New Issue