Skip to content

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

adding confirm dialog for deleting perspective and filetype in the settings

uggrock3582f8f9a0da
diff --git a/data/js/options.ui.js b/data/js/options.ui.js
index d7e927e56..6a4ce599c 100644
--- a/data/js/options.ui.js
+++ b/data/js/options.ui.js
@@ -32,8 +32,14 @@ define(function(require, exports, module) {
.append($('<select class="form-control flexMaxWidth"></select>'))
.append($('<button class="btn btn-link" style="width: 40px" data-i18n="[title]ns.dialogs:removePerspectiveTooltip"><i class="fa fa-times"></button>')
.click(function() {
- $(this).parent().parent().remove();
- })));
+ var row4Remove = $(this).parent().parent();
+ TSCORE.showConfirmDialog(
+ $.i18n.t('ns.dialogs:titleConfirm'),
+ "Do you really want to remove this perspective?",
+ function() {
+ row4Remove.remove();
+ });
+ })));
generateSelectOptions(perspectiveControl.find('select'), TSCORE.Config.getPerspectiveExtensions(), perspectiveId, "ns.dialogs:choosePerspective");
perspectiveControl.i18n();
parent.append(perspectiveControl);
@@ -47,7 +53,13 @@ define(function(require, exports, module) {
.append($('<select class="fteditor form-control flexMaxWidth"></select>'))
.append($('<button style="width: 30px" class="btn btn-link" data-i18n="[title]ns.dialogs:removeFileTypeTooltip"><i class="fa fa-times"></button>')
.click(function() {
- $(this).parent().parent().remove();
+ var row4Remove = $(this).parent().parent();
+ TSCORE.showConfirmDialog(
+ $.i18n.t('ns.dialogs:titleConfirm'),
+ "Do you really want to remove this file type?",
+ function() {
+ row4Remove.remove();
+ });
})));
generateSelectOptions(fileTypeControl.find('.ftviewer'), TSCORE.Config.getViewerExtensions(), viewerId, "ns.dialogs:chooseFileViewer");
generateSelectOptions(fileTypeControl.find('.fteditor'), TSCORE.Config.getEditorExtensions(), editorId, "ns.dialogs:chooseFileEditor");