[SSE] Remove all cell watches

This commit is contained in:
Julia Radzhabova 2022-06-29 20:24:40 +03:00
parent 0800af0484
commit 9475364cfb
6 changed files with 43 additions and 11 deletions

View file

@ -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;
}

View file

@ -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.<br>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.<br>Do you want to continue?'
}
})(), SSE.Controllers.Main || {}))

View file

@ -4,17 +4,17 @@
<tr>
<td class="padding-large">
<button type="button" class="btn btn-text-default auto sort-dialog-btn-text" id="watch-dialog-btn-add"><%= scope.textAdd %></button>
<button type="button" class="btn btn-text-default auto sort-dialog-btn-text" id="watch-dialog-btn-delete"><%= scope.textDelete %></button>
<div id="watch-dialog-btn-delete" style="display: inline-block;"></div>
</td>
</tr>
<tr>
<td>
<label class="header" style="width: 76px;"><%= scope.textBook %></label><!--
--><label class="header" style="width: 70px;"><%= scope.textSheet %></label><!--
--><label class="header" style="width: 70px;"><%= scope.textName %></label><!--
--><label class="header" style="width: 70px;"><%= scope.textCell %></label><!--
--><label class="header" style="width: 110px;"><%= scope.textValue %></label><!--
--><label class="header" style=""><%= scope.textFormula %></label>
<label class="header" style="width: 76px;overflow: hidden;text-overflow: ellipsis;vertical-align: middle;"><%= scope.textBook %></label><!--
--><label class="header" style="width: 70px;overflow: hidden;text-overflow: ellipsis;vertical-align: middle;"><%= scope.textSheet %></label><!--
--><label class="header" style="width: 70px;overflow: hidden;text-overflow: ellipsis;vertical-align: middle;"><%= scope.textName %></label><!--
--><label class="header" style="width: 70px;overflow: hidden;text-overflow: ellipsis;vertical-align: middle;"><%= scope.textCell %></label><!--
--><label class="header" style="width: 110px;overflow: hidden;text-overflow: ellipsis;vertical-align: middle;"><%= scope.textValue %></label><!--
--><label class="header" style="width: 140px;overflow: hidden;text-overflow: ellipsis;vertical-align: middle;"><%= scope.textFormula %></label>
</td>
</tr>
<tr>

View file

@ -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',

View file

@ -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.<br>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.<br>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",

View file

@ -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": "Защитить книгу",