diff options
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/js/js.js b/core/js/js.js index 0c842f05593..c38eebbff29 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -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 |