TagSpaces is an offline, open source, document manager with tagging support
Implementing remove from UI functionality
Ilianf2c67b03485b
diff --git a/data/ext/perspectiveGrid/extension.js b/data/ext/perspectiveGrid/extension.jsindex 2737b177b..511ba7b69 100644--- a/data/ext/perspectiveGrid/extension.js+++ b/data/ext/perspectiveGrid/extension.js@@ -53,10 +53,13 @@ define(function(require, exports, module) {UI.clearSelectedFiles();};- var removeFileFromUI = function(filePath) {- console.log("Removing from UI");- $("#"+extensionID+"Container li[filepath='"+filePath+"']").remove();+ var removeFileUI = function(filePath) {+ UI.removeFileUI(filePath);};++ var updateFileUI = function(oldFilePath, newFilePath) {+ UI.updateFileUI(oldFilePath, newFilePath);+ };var getNextFile = function (filePath) {return UI.getNextFile(filePath);@@ -81,6 +84,7 @@ define(function(require, exports, module) {exports.clearSelectedFiles = clearSelectedFiles;exports.getNextFile = getNextFile;exports.getPrevFile = getPrevFile;- exports.removeFileFromUI = removeFileFromUI;+ exports.removeFileUI = removeFileUI;+ exports.updateFileUI = updateFileUI;});\ No newline at end of filediff --git a/data/ext/perspectiveGrid/perspectiveUI.js b/data/ext/perspectiveGrid/perspectiveUI.jsindex 2c9cf5922..cbe092531 100644--- a/data/ext/perspectiveGrid/perspectiveUI.js+++ b/data/ext/perspectiveGrid/perspectiveUI.js@@ -41,7 +41,6 @@ console.log("Loading UI for perspectiveDefault");}}- // Helper function user by basic and search viewsExtUI.prototype.createFileTile = function(title, filePath, fileExt, fileTags) {var self = this;@@ -618,6 +617,21 @@ console.log("Loading UI for perspectiveDefault");tagButton.prop('disabled', true);}};++ ExtUI.prototype.removeFileUI = function(filePath) {+ console.log("Removing file from UI");+ $("#"+this.extensionID+"Container li[filepath='"+filePath+"']").remove();+ };++ ExtUI.prototype.updateFileUI = function(oldFilePath, newFilePath) {+ console.log("Updating file from UI");+ var title = TSCORE.TagUtils.extractTitle(newFilePath),+ fileExt = TSCORE.TagUtils.extractFileExtension(newFilePath),+ fileTags = TSCORE.TagUtils.extractTags(newFilePath);++ $("#"+this.extensionID+"Container li[filepath='"+oldFilePath+"']")+ .replaceWith(this.createFileTile(title, newFilePath, fileExt, fileTags));+ };ExtUI.prototype.getNextFile = function(filePath) {var nextFilePath = undefined;@@ -631,7 +645,7 @@ console.log("Loading UI for perspectiveDefault");nextFilePath = self.searchResults[0][TSCORE.fileListFILEPATH];}}- console.log("Path: "+entry[TSCORE.fileListFILEPATH]);+ //console.log("Path: "+entry[TSCORE.fileListFILEPATH]);});TSCORE.PerspectiveManager.clearSelectedFiles();console.log("Next file: "+nextFilePath);@@ -650,7 +664,7 @@ console.log("Loading UI for perspectiveDefault");prevFilePath = self.searchResults[self.searchResults.length-1][TSCORE.fileListFILEPATH];}}- console.log("Path: "+entry[TSCORE.fileListFILEPATH]);+ //console.log("Path: "+entry[TSCORE.fileListFILEPATH]);});TSCORE.PerspectiveManager.clearSelectedFiles();console.log("Prev file: "+prevFilePath);