From b21a33601e86202e8bc417dfaf95946b4069f30c Mon Sep 17 00:00:00 2001 From: OVSharova Date: Sat, 15 Oct 2022 16:16:42 +0300 Subject: [PATCH] removed check for multiselect --- .../main/app/view/WatchDialog.js | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/WatchDialog.js b/apps/spreadsheeteditor/main/app/view/WatchDialog.js index 02c739c96..c938922b5 100644 --- a/apps/spreadsheeteditor/main/app/view/WatchDialog.js +++ b/apps/spreadsheeteditor/main/app/view/WatchDialog.js @@ -192,12 +192,8 @@ define([ 'text!spreadsheeteditor/main/app/template/WatchDialog.template', if (this._deletedIndex!==undefined) { var store = this.watchList.store; (store.length>0) && this.watchList.selectByIndex(this._deletedIndex 0) && this.watchList.scrollToRecord(selectedRec[0]); - } - else - this.watchList.scrollToRecord(this.watchList.getSelectedRec()); + var selectedRec = this.watchList.getSelectedRec(); + (selectedRec.length > 0) && this.watchList.scrollToRecord(selectedRec[0]); this._fromKeyDown && this.watchList.focus(); this._fromKeyDown = false; this._deletedIndex=undefined; @@ -237,17 +233,12 @@ define([ 'text!spreadsheeteditor/main/app/template/WatchDialog.template', var me = this; var rec = this.watchList.getSelectedRec(); if (rec) { - if(this.watchList.options.multiSelect) { - var props=[]; - _.each(rec, function (r, i) { - me._deletedIndex = me.watchList.store.indexOf(r)-props.length; - props[i] =r.get('props'); - }); - this.api.asc_deleteCellWatches(props); - } else { - this._deletedIndex = this.watchList.store.indexOf(rec); - this.api.asc_deleteCellWatches([rec.get('props')]); - } + var props=[]; + _.each(rec, function (r, i) { + me._deletedIndex = me.watchList.store.indexOf(r)-props.length; + props[i] =r.get('props'); + }); + this.api.asc_deleteCellWatches(props); } }, @@ -270,7 +261,7 @@ define([ 'text!spreadsheeteditor/main/app/template/WatchDialog.template', }, updateButtons: function() { - this.btnDelete.setDisabled(this.watchList.store.length<1 || !this.watchList.getSelectedRec() || (this.watchList.multiSelect && this.watchList.getSelectedRec().length==0)); + this.btnDelete.setDisabled(this.watchList.store.length<1 || this.watchList.getSelectedRec().length==0); this.watchList.scroller && this.watchList.scroller.update({alwaysVisibleY: true}); },