From 9475364cfbffb8b1a33b0170a8e3cb2e6174c9ee Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 29 Jun 2022 20:24:40 +0300 Subject: [PATCH] [SSE] Remove all cell watches --- apps/common/main/resources/less/buttons.less | 4 +++ .../main/app/controller/Main.js | 2 +- .../main/app/template/WatchDialog.template | 14 +++++----- .../main/app/view/WatchDialog.js | 28 +++++++++++++++++-- apps/spreadsheeteditor/main/locale/en.json | 3 +- apps/spreadsheeteditor/main/locale/ru.json | 3 ++ 6 files changed, 43 insertions(+), 11 deletions(-) diff --git a/apps/common/main/resources/less/buttons.less b/apps/common/main/resources/less/buttons.less index 4540fadef..1f98dfd8b 100644 --- a/apps/common/main/resources/less/buttons.less +++ b/apps/common/main/resources/less/buttons.less @@ -874,6 +874,10 @@ border: @scaled-one-px-value solid @border-regular-control; .border-radius(@border-radius-small); + &.auto { + width: auto; + } + &.dropdown-toggle { width: 13px; } diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 938646c09..1d7c28099 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -3612,7 +3612,7 @@ define([ textRequestMacros: 'A macro makes a request to URL. Do you want to allow the request to the %1?', textRememberMacros: 'Remember my choice for all macros', confirmAddCellWatches: 'This action will add {0} cell watches.
Do you want to continue?', - confirmAddCellWatchesMax: 'This action will add only {0} cell watches by memory save reason. Do you want to continue?' + confirmAddCellWatchesMax: 'This action will add only {0} cell watches by memory save reason.
Do you want to continue?' } })(), SSE.Controllers.Main || {})) diff --git a/apps/spreadsheeteditor/main/app/template/WatchDialog.template b/apps/spreadsheeteditor/main/app/template/WatchDialog.template index 494666f0b..d9dfe4296 100644 --- a/apps/spreadsheeteditor/main/app/template/WatchDialog.template +++ b/apps/spreadsheeteditor/main/app/template/WatchDialog.template @@ -4,17 +4,17 @@ - +
- + diff --git a/apps/spreadsheeteditor/main/app/view/WatchDialog.js b/apps/spreadsheeteditor/main/app/view/WatchDialog.js index 352beb215..61ecae435 100644 --- a/apps/spreadsheeteditor/main/app/view/WatchDialog.js +++ b/apps/spreadsheeteditor/main/app/view/WatchDialog.js @@ -109,10 +109,26 @@ define([ 'text!spreadsheeteditor/main/app/template/WatchDialog.template', this.btnAdd.on('click', _.bind(this.onAddWatch, this, false)); this.btnDelete = new Common.UI.Button({ - el: $('#watch-dialog-btn-delete', this.$window) + parentEl: $('#watch-dialog-btn-delete', this.$window), + cls: 'btn-text-split-default auto', + caption: this.textDelete, + split: true, + menu : new Common.UI.Menu({ + style: 'min-width:100px;', + items: [ + { + caption: this.textDelete, + value: 0 + }, + { + caption: this.textDeleteAll, + value: 1 + }] + }) }); + $(this.btnDelete.cmpEl.find('button')[0]).css('min-width', '87px'); this.btnDelete.on('click', _.bind(this.onDeleteWatch, this)); - + this.btnDelete.menu.on('item:click', _.bind(this.onDeleteMenu, this)); this.afterRender(); }, @@ -197,6 +213,13 @@ define([ 'text!spreadsheeteditor/main/app/template/WatchDialog.template', } }, + onDeleteMenu: function(menu, item) { + if (item.value == 1) { + this.api.asc_deleteCellWatches(undefined, true); + } else + this.onDeleteWatch(); + }, + onSelectWatch: function(lisvView, itemView, record) { this.updateButtons(); }, @@ -222,6 +245,7 @@ define([ 'text!spreadsheeteditor/main/app/template/WatchDialog.template', txtTitle: 'Watch Window', textAdd: 'Add watch', textDelete: 'Delete watch', + textDeleteAll: 'Delete all', closeButtonText: 'Close', textBook: 'Book', textSheet: 'Sheet', diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index f83552b51..7cbbc188e 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1106,7 +1106,7 @@ "SSE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", "SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", "SSE.Controllers.Main.confirmAddCellWatches": "This action will add {0} cell watches.
Do you want to continue?", - "SSE.Controllers.Main.confirmAddCellWatchesMax": "This action will add only {0} cell watches by memory save reason. Do you want to continue?", + "SSE.Controllers.Main.confirmAddCellWatchesMax": "This action will add only {0} cell watches by memory save reason.
Do you want to continue?", "SSE.Controllers.Print.strAllSheets": "All Sheets", "SSE.Controllers.Print.textFirstCol": "First column", "SSE.Controllers.Print.textFirstRow": "First row", @@ -3675,6 +3675,7 @@ "SSE.Views.WatchDialog.txtTitle": "Watch Window", "SSE.Views.WatchDialog.textAdd": "Add watch", "SSE.Views.WatchDialog.textDelete": "Delete watch", + "SSE.Views.WatchDialog.textDeleteAll": "Delete all", "SSE.Views.WatchDialog.closeButtonText": "Close", "SSE.Views.WatchDialog.textBook": "Book", "SSE.Views.WatchDialog.textSheet": "Sheet", diff --git a/apps/spreadsheeteditor/main/locale/ru.json b/apps/spreadsheeteditor/main/locale/ru.json index b284af0d7..bd27c2476 100644 --- a/apps/spreadsheeteditor/main/locale/ru.json +++ b/apps/spreadsheeteditor/main/locale/ru.json @@ -3664,6 +3664,9 @@ "SSE.Views.ViewTab.tipCreate": "Создать представление листа", "SSE.Views.ViewTab.tipFreeze": "Закрепить области", "SSE.Views.ViewTab.tipSheetView": "Представление листа", + "SSE.Views.WatchDialog.textAdd": "Добавить контрольное значение", + "SSE.Views.WatchDialog.textDelete": "Удалить контрольное значение", + "SSE.Views.WatchDialog.textDeleteAll": "Удалить все", "SSE.Views.WBProtection.hintAllowRanges": "Разрешить редактировать диапазоны", "SSE.Views.WBProtection.hintProtectSheet": "Защитить лист", "SSE.Views.WBProtection.hintProtectWB": "Защитить книгу",