TagSpaces is an offline, open source, document manager with tagging support
Added delete selected files functionality
Borislav Sapundzhiev26ed0d449d04
diff --git a/data/ext/perspectiveGrid/perspectiveUI.js b/data/ext/perspectiveGrid/perspectiveUI.jsindex fafd8c43e..2a7ea7d4f 100644--- a/data/ext/perspectiveGrid/perspectiveUI.js+++ b/data/ext/perspectiveGrid/perspectiveUI.js@@ -229,6 +229,17 @@ define(function(require, exports, module) {$("#addFileInput").click();});+ $("#" + this.extensionID + "DeleteSelectedFilesButton")+ .click(function() {++ TSCORE.showConfirmDialog($.i18n.t('ns.dialogs:fileDeleteTitleConfirm'),+ $.i18n.t('ns.dialogs:selectedFilesDeleteContentConfirm'), function() {+ TSCORE.selectedFiles.forEach(function(file) {+ TSCORE.IO.deleteElement(file);+ });+ });+ });+// Init Tag Context Menusthis.viewContainer.on("contextmenu click", ".tagButton", function() {TSCORE.hideAllDropDownMenus();@@ -678,13 +689,17 @@ define(function(require, exports, module) {console.log("Entering element activation handler...");var tagButton = $("#" + this.extensionID + "TagButton");+ var deleteSelectedFilesButton = $("#" + this.extensionID + "DeleteSelectedFilesButton");if (TSCORE.selectedFiles.length > 1) {tagButton.prop('disabled', false);+ deleteSelectedFilesButton.prop('disabled', false);} else if (TSCORE.selectedFiles.length === 1) {tagButton.prop('disabled', false);+ deleteSelectedFilesButton.prop('disabled', false);} else {tagButton.prop('disabled', true);+ deleteSelectedFilesButton.prop('disabled', true);}};diff --git a/data/ext/perspectiveGrid/toolbar.html b/data/ext/perspectiveGrid/toolbar.htmlindex 045114373..227211c18 100644--- a/data/ext/perspectiveGrid/toolbar.html+++ b/data/ext/perspectiveGrid/toolbar.html@@ -40,6 +40,9 @@<button class="btn btn-link" data-toggle="button" title="Toggle file thumbnails" id="{{id}}ShowTmbButton"><i class="fa fa-picture-o fa-lg"></i></button>+ <button class="btn btn-link" data-i18n="[title]ns.perspectiveList:deleteSelectedFilesTooltip" id="{{id}}DeleteSelectedFilesButton">+ <i class="fa fa-trash fa-lg"></i>+ </button></div><div class="btn-group"><button class="btn btn-link" type="button" title="Group" id="{{id}}GroupingButton" data-toggle="dropdown">