[SSE] Refactoring watch dialog

This commit is contained in:
Julia Radzhabova 2022-06-24 17:41:37 +03:00
parent fbc99d7b5e
commit 4e2af2ab44
2 changed files with 16 additions and 16 deletions

View file

@ -9,17 +9,17 @@
</tr>
<tr>
<td>
<label class="header" style="width: 70px;"><%= 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: 100px;"><%= scope.textValue %></label>
<label class="header" style=""><%= scope.textFormula %></label>
<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>
</td>
</tr>
<tr>
<td class="padding-small">
<div id="watch-dialog-list" class="" style="width:100%; height: 143px;"></div>
<div id="watch-dialog-list" class="range-tableview" style="width:100%; height: 143px;"></div>
</td>
</tr>
</table>

View file

@ -89,12 +89,12 @@ define([ 'text!spreadsheeteditor/main/app/template/WatchDialog.template',
simpleAddMode: true,
itemTemplate: _.template([
'<div id="<%= id %>" class="list-item" style="width: 100%;display:inline-block;pointer-events:none;">',
'<div style="width:141px;padding-right: 5px;"><%= Common.Utils.String.htmlEncode(book) %></div>',
'<div style="width:141px;padding-right: 5px;"><%= Common.Utils.String.htmlEncode(sheet) %></div>',
'<div style="width:141px;padding-right: 5px;"><%= Common.Utils.String.htmlEncode(name) %></div>',
'<div style="width:141px;padding-right: 5px;"><%= cell %></div>',
'<div style="width:141px;padding-right: 5px;"><%= value %></div>',
'<div style="width:117px;"><%= formula %></div>',
'<div style="width:70px;padding-right: 5px;"><%= Common.Utils.String.htmlEncode(book) %></div>',
'<div style="width:70px;padding-right: 5px;"><%= Common.Utils.String.htmlEncode(sheet) %></div>',
'<div style="width:70px;padding-right: 5px;"><%= Common.Utils.String.htmlEncode(name) %></div>',
'<div style="width:70px;padding-right: 5px;"><%= cell %></div>',
'<div style="width:110px;padding-right: 5px;"><%= value %></div>',
'<div style="width:135px;"><%= formula %></div>',
'</div>'
].join('')),
tabindex: 1
@ -129,7 +129,7 @@ define([ 'text!spreadsheeteditor/main/app/template/WatchDialog.template',
_setDefaults: function (props) {
this.refreshList();
this.api.asc_registerCallback('asc_onRefreshWatchList', this.wrapEvents.onRefreshWatchList);
this.api.asc_registerCallback('asc_onUpdateCellWatches', this.wrapEvents.onRefreshWatchList);
},
refreshList: function() {
@ -185,7 +185,7 @@ define([ 'text!spreadsheeteditor/main/app/template/WatchDialog.template',
onDeleteWatch: function() {
var rec = this.watchList.getSelectedRec();
if (rec) {
this.api.asc_deleteCellWatches(rec.get(props));
this.api.asc_deleteCellWatches([rec.get('props')]);
}
this.refreshList();
},
@ -205,7 +205,7 @@ define([ 'text!spreadsheeteditor/main/app/template/WatchDialog.template',
},
close: function () {
this.api.asc_unregisterCallback('asc_onRefreshWatchList', this.wrapEvents.onRefreshWatchList);
this.api.asc_unregisterCallback('asc_onUpdateCellWatches', this.wrapEvents.onRefreshWatchList);
Common.Views.AdvancedSettingsWindow.prototype.close.call(this);
},