]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cleanup code as suggested by @icewind1991 4068/head
authorLukas Reschke <lukas@statuscode.ch>
Sun, 26 Mar 2017 17:45:36 +0000 (19:45 +0200)
committerLukas Reschke <lukas@statuscode.ch>
Sun, 26 Mar 2017 17:45:36 +0000 (19:45 +0200)
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
core/js/js.js

index 4f0c63f40f0b1011bf953617980e003b4fe0a09f..8c1a2e157d0dddda7bdd261af00828d455bfe6bd 100644 (file)
@@ -367,24 +367,16 @@ var OCP = {},
        addScript:function(app,script,ready){
                var deferred, path=OC.filePath(app,'js',script+'.js');
                if(!OC.addScript.loaded[path]) {
-                       if(ready) {
-                               deferred = jQuery.ajax({
-                                       url: path,
-                                       cache: true,
-                                       success: function (content) {
-                                               eval(content);
+                       deferred = jQuery.ajax({
+                               url: path,
+                               cache: true,
+                               success: function (content) {
+                                       eval(content);
+                                       if(ready) {
                                                ready();
                                        }
-                               });
-                       } else {
-                               deferred = jQuery.ajax({
-                                       url: path,
-                                       cache: true,
-                                       success: function (content) {
-                                               eval(content);
-                                       }
-                               });
-                       }
+                               }
+                       });
                        OC.addScript.loaded[path] = deferred;
                } else {
                        if (ready) {