Skip to content

TagSpaces is an offline, open source, document manager with tagging support

editorText - new promise api

Borislav Sapundzhiev3c7c8fca1a14
diff --git a/data/ext/editorText/extension.js b/data/ext/editorText/extension.js
index 3a126c71a..3aa40f479 100644
--- a/data/ext/editorText/extension.js
+++ b/data/ext/editorText/extension.js
@@ -80,7 +80,14 @@ define(function(require, exports, module) {
});
cmEditor.setSize("100%", "100%");
- TSCORE.IO.loadTextFile(filePath);
+ TSCORE.IO.loadTextFilePromise(filePath).then(function(content) {
+ exports.setContent(content);
+ },
+ function(error) {
+ TSCORE.hideLoadingAnimation();
+ TSCORE.showAlertDialog("Loading " + filePath + " failed.");
+ console.error("Loading file " + filePath + " failed " + error);
+ });
});
};