summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-03-26 15:13:03 -0600
committerGitHub <noreply@github.com>2017-03-26 15:13:03 -0600
commit96d4e1cab5ebf030832bbd052d8f4705b9b726d2 (patch)
tree373f4ba6eaae52f89733483fad4c4b64a15deae4
parent3ba114dbbca281d8decdbc39cf6942856ade7612 (diff)
parent3c1d76c282d5b5e30c971ac6241ab35d4476b859 (diff)
downloadnextcloud-server-96d4e1cab5ebf030832bbd052d8f4705b9b726d2.tar.gz
nextcloud-server-96d4e1cab5ebf030832bbd052d8f4705b9b726d2.zip
Merge pull request #4068 from nextcloud/use-eval-instead-of-get-script
Use eval instead of $.script
-rw-r--r--core/js/js.js23
1 files changed, 14 insertions, 9 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 370e68f5602..8c1a2e157d0 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -366,15 +366,20 @@ var OCP = {},
*/
addScript:function(app,script,ready){
var deferred, path=OC.filePath(app,'js',script+'.js');
- if(!OC.addScript.loaded[path]){
- if(ready){
- deferred=$.getScript(path,ready);
- }else{
- deferred=$.getScript(path);
- }
- OC.addScript.loaded[path]=deferred;
- }else{
- if(ready){
+ if(!OC.addScript.loaded[path]) {
+ deferred = jQuery.ajax({
+ url: path,
+ cache: true,
+ success: function (content) {
+ eval(content);
+ if(ready) {
+ ready();
+ }
+ }
+ });
+ OC.addScript.loaded[path] = deferred;
+ } else {
+ if (ready) {
ready();
}
}