Use jQuery.getScript to dynamically load script
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
5b61ef9213
commit
365f68372f
|
@ -368,15 +368,9 @@ var OCP = {},
|
|||
addScript:function(app,script,ready){
|
||||
var deferred, path=OC.filePath(app,'js',script+'.js');
|
||||
if(!OC.addScript.loaded[path]) {
|
||||
deferred = jQuery.ajax({
|
||||
url: path,
|
||||
cache: true,
|
||||
success: function (content) {
|
||||
window.eval(content);
|
||||
if(ready) {
|
||||
ready();
|
||||
}
|
||||
}
|
||||
deferred = $.Deferred();
|
||||
$.getScript(path, function() {
|
||||
deferred.resolve();
|
||||
});
|
||||
OC.addScript.loaded[path] = deferred;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue