fix bugs
This commit is contained in:
parent
3d7df44625
commit
4ac240a7b1
|
@ -738,7 +738,7 @@ define([
|
||||||
if (_.indexOf(this.moveKeys, data.keyCode)>-1 || data.keyCode==Common.UI.Keys.RETURN) {
|
if (_.indexOf(this.moveKeys, data.keyCode)>-1 || data.keyCode==Common.UI.Keys.RETURN) {
|
||||||
data.preventDefault();
|
data.preventDefault();
|
||||||
data.stopPropagation();
|
data.stopPropagation();
|
||||||
var rec =(this.multiSelect) ? this.currentSelectedRec : this.getSelectedRec();
|
var rec =(this.multiSelect) ? this.extremeSeletedRec : this.getSelectedRec();
|
||||||
if (this.lastSelectedRec === null)
|
if (this.lastSelectedRec === null)
|
||||||
this.lastSelectedRec = rec;
|
this.lastSelectedRec = rec;
|
||||||
if (data.keyCode == Common.UI.Keys.RETURN) {
|
if (data.keyCode == Common.UI.Keys.RETURN) {
|
||||||
|
@ -752,7 +752,7 @@ define([
|
||||||
this.parentMenu.hide();
|
this.parentMenu.hide();
|
||||||
} else {
|
} else {
|
||||||
this.pressedCtrl=false;
|
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 (idx<0) {
|
||||||
if (data.keyCode==Common.UI.Keys.LEFT) {
|
if (data.keyCode==Common.UI.Keys.LEFT) {
|
||||||
var target = $(e.target).closest('.dropdown-submenu.over');
|
var target = $(e.target).closest('.dropdown-submenu.over');
|
||||||
|
@ -856,7 +856,10 @@ define([
|
||||||
this.lastSelectedRec = null;
|
this.lastSelectedRec = null;
|
||||||
} else {
|
} else {
|
||||||
var selectedRec = this.getSelectedRec();
|
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]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -192,8 +192,10 @@ define([ 'text!spreadsheeteditor/main/app/template/WatchDialog.template',
|
||||||
if (this._deletedIndex!==undefined) {
|
if (this._deletedIndex!==undefined) {
|
||||||
var store = this.watchList.store;
|
var store = this.watchList.store;
|
||||||
(store.length>0) && this.watchList.selectByIndex(this._deletedIndex<store.length ? this._deletedIndex : store.length-1);
|
(store.length>0) && this.watchList.selectByIndex(this._deletedIndex<store.length ? this._deletedIndex : store.length-1);
|
||||||
if(this.watchList.options.multiSelect)
|
if(this.watchList.options.multiSelect) {
|
||||||
this.watchList.scrollToRecord(this.watchList.getSelectedRec()[0]);
|
var selectedRec = this.watchList.getSelectedRec();
|
||||||
|
(selectedRec.length > 0) && this.watchList.scrollToRecord(selectedRec[0]);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
this.watchList.scrollToRecord(this.watchList.getSelectedRec());
|
this.watchList.scrollToRecord(this.watchList.getSelectedRec());
|
||||||
this._fromKeyDown && this.watchList.focus();
|
this._fromKeyDown && this.watchList.focus();
|
||||||
|
@ -238,7 +240,7 @@ define([ 'text!spreadsheeteditor/main/app/template/WatchDialog.template',
|
||||||
if(this.watchList.options.multiSelect) {
|
if(this.watchList.options.multiSelect) {
|
||||||
var props=[];
|
var props=[];
|
||||||
_.each(rec, function (r, i) {
|
_.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');
|
props[i] =r.get('props');
|
||||||
});
|
});
|
||||||
this.api.asc_deleteCellWatches(props);
|
this.api.asc_deleteCellWatches(props);
|
||||||
|
@ -268,7 +270,7 @@ define([ 'text!spreadsheeteditor/main/app/template/WatchDialog.template',
|
||||||
},
|
},
|
||||||
|
|
||||||
updateButtons: function() {
|
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});
|
this.watchList.scroller && this.watchList.scroller.update({alwaysVisibleY: true});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue