This commit is contained in:
OVSharova 2022-10-15 14:48:58 +03:00
parent 3d7df44625
commit 4ac240a7b1
2 changed files with 12 additions and 7 deletions

View file

@ -738,7 +738,7 @@ define([
if (_.indexOf(this.moveKeys, data.keyCode)>-1 || data.keyCode==Common.UI.Keys.RETURN) {
data.preventDefault();
data.stopPropagation();
var rec =(this.multiSelect) ? this.currentSelectedRec : this.getSelectedRec();
var rec =(this.multiSelect) ? this.extremeSeletedRec : this.getSelectedRec();
if (this.lastSelectedRec === null)
this.lastSelectedRec = rec;
if (data.keyCode == Common.UI.Keys.RETURN) {
@ -752,7 +752,7 @@ define([
this.parentMenu.hide();
} else {
this.pressedCtrl=false;
var idx = (!this.multiSelect)? _.indexOf(this.store.models, rec):_.indexOf(this.store.models, this.extremeSeletedRec);
var idx = _.indexOf(this.store.models, rec);
if (idx<0) {
if (data.keyCode==Common.UI.Keys.LEFT) {
var target = $(e.target).closest('.dropdown-submenu.over');
@ -856,7 +856,10 @@ define([
this.lastSelectedRec = null;
} else {
var selectedRec = this.getSelectedRec();
this.scrollToRecord((!this.multiSelect) ? selectedRec : selectedRec[selectedRec.length - 1]);
if (!this.multiSelect)
this.scrollToRecord(selectedRec);
else if(selectedRec.length > 0)
this.scrollToRecord(selectedRec[selectedRec.length - 1]);
}
},

View file

@ -192,8 +192,10 @@ 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<store.length ? this._deletedIndex : store.length-1);
if(this.watchList.options.multiSelect)
this.watchList.scrollToRecord(this.watchList.getSelectedRec()[0]);
if(this.watchList.options.multiSelect) {
var selectedRec = this.watchList.getSelectedRec();
(selectedRec.length > 0) && this.watchList.scrollToRecord(selectedRec[0]);
}
else
this.watchList.scrollToRecord(this.watchList.getSelectedRec());
this._fromKeyDown && this.watchList.focus();
@ -238,7 +240,7 @@ define([ 'text!spreadsheeteditor/main/app/template/WatchDialog.template',
if(this.watchList.options.multiSelect) {
var props=[];
_.each(rec, function (r, i) {
me._deletedIndex = me.watchList.store.indexOf(r);
me._deletedIndex = me.watchList.store.indexOf(r)-props.length;
props[i] =r.get('props');
});
this.api.asc_deleteCellWatches(props);
@ -268,7 +270,7 @@ define([ 'text!spreadsheeteditor/main/app/template/WatchDialog.template',
},
updateButtons: function() {
this.btnDelete.setDisabled(this.watchList.store.length<1 || !this.watchList.getSelectedRec());
this.btnDelete.setDisabled(this.watchList.store.length<1 || !this.watchList.getSelectedRec() || (this.watchList.multiSelect && this.watchList.getSelectedRec().length==0));
this.watchList.scroller && this.watchList.scroller.update({alwaysVisibleY: true});
},