summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-03-26 19:45:36 +0200
committerLukas Reschke <lukas@statuscode.ch>2017-03-26 19:45:36 +0200
commit3c1d76c282d5b5e30c971ac6241ab35d4476b859 (patch)
tree22b89932736d76fe965bf6884a3021d0a0637a4a /core/js
parentfea21087104280cf3245d7916155c87e52de44ca (diff)
downloadnextcloud-server-3c1d76c282d5b5e30c971ac6241ab35d4476b859.tar.gz
nextcloud-server-3c1d76c282d5b5e30c971ac6241ab35d4476b859.zip
Cleanup code as suggested by @icewind1991
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'core/js')
-rw-r--r--core/js/js.js24
1 files changed, 8 insertions, 16 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 4f0c63f40f0..8c1a2e157d0 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -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) {