removed check for multiselect
This commit is contained in:
		
							parent
							
								
									4ac240a7b1
								
							
						
					
					
						commit
						b21a33601e
					
				| 
						 | 
				
			
			@ -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<store.length ? this._deletedIndex : store.length-1);
 | 
			
		||||
                    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();
 | 
			
		||||
                    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')]);
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -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});
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue