Skip to content
Snippets Groups Projects
Commit 92c782c1 authored by Robin Appelman's avatar Robin Appelman
Browse files

return the jQuery deferred object when using OC.loadScript

parent d786194d
No related branches found
No related tags found
No related merge requests found
......@@ -120,18 +120,19 @@ OC={
*/
addScript:function(app,script,ready){
var path=OC.filePath(app,'js',script+'.js');
if(OC.addScript.loaded.indexOf(path)==-1){
OC.addScript.loaded.push(path);
if(!OC.addScript.loaded[path]){
if(ready){
$.getScript(path,ready);
var deferred=$.getScript(path,ready);
}else{
$.getScript(path);
var deferred=$.getScript(path);
}
OC.addScript.loaded[path]=deferred;
}else{
if(ready){
ready();
}
}
return OC.addScript.loaded[path];
},
/**
* load a css file and load it
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment