diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-30 16:06:23 +0300 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-30 16:06:23 +0300 |
commit | b3eeca866171c67a82cde11835209e7cdb482347 (patch) | |
tree | 25f669e8d6dfad788b5d0ea03a7b20de43c8e955 | |
parent | c3bfe18e0018f49297a0236d8a26f37f95491cf9 (diff) | |
parent | dcae4d309f44e1735c929368d5a3edf563b62041 (diff) |
Merge pull request #116 from owncloud/remove-duplicate-ajax
Remove duplicate ajax call
-rw-r--r-- | js/editor.js | 28 |
1 files changed, 5 insertions, 23 deletions
diff --git a/js/editor.js b/js/editor.js index ef2d107..620a76e 100644 --- a/js/editor.js +++ b/js/editor.js @@ -464,23 +464,6 @@ var Files_Texteditor = { * Loads the data through AJAX */ loadFile: function(dir, filename, success, failure) { - var _self = this; - var data = $.getJSON( - OC.filePath('files_texteditor', 'ajax', 'loadfile.php'), - {file: filename, dir: dir}, - function (result) { - if(result.status === 'success') { - // Call success callback - OCA.Files_Texteditor.file.writeable = result.data.writeable; - OCA.Files_Texteditor.file.mime = result.data.mime; - OCA.Files_Texteditor.file.mtime = result.data.mtime; - success(OCA.Files_Texteditor.file, result.data.filecontents); - } else { - // Call failure callback - failure(result.data.message); - } - }); - $.get( OC.generateUrl('/apps/files_texteditor/ajax/loadfile'), { @@ -488,12 +471,11 @@ var Files_Texteditor = { dir: dir } ).done(function(data) { - // Call success callback - OCA.Files_Texteditor.file.writeable = data.writeable; - OCA.Files_Texteditor.file.mime = data.mime; - OCA.Files_Texteditor.file.mtime = data.mtime; - success(OCA.Files_Texteditor.file, data.filecontents); - + // Call success callback + OCA.Files_Texteditor.file.writeable = data.writeable; + OCA.Files_Texteditor.file.mime = data.mime; + OCA.Files_Texteditor.file.mtime = data.mtime; + success(OCA.Files_Texteditor.file, data.filecontents); }).fail(function(jqXHR) { failure(JSON.parse(jqXHR.responseText).message); }); |