Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/files_texteditor.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-09-30 16:06:23 +0300
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-30 16:06:23 +0300
commitb3eeca866171c67a82cde11835209e7cdb482347 (patch)
tree25f669e8d6dfad788b5d0ea03a7b20de43c8e955 /js
parentc3bfe18e0018f49297a0236d8a26f37f95491cf9 (diff)
parentdcae4d309f44e1735c929368d5a3edf563b62041 (diff)
Merge pull request #116 from owncloud/remove-duplicate-ajax
Remove duplicate ajax call
Diffstat (limited to 'js')
-rw-r--r--js/editor.js28
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);
});