[SSE] Refactoring resize of filter window

This commit is contained in:
Julia Radzhabova 2019-08-12 13:07:56 +03:00
parent 18bb1b42cc
commit a65635c977

View file

@ -523,6 +523,7 @@ define([
Common.UI.Window.prototype.initialize.call(this, _options); Common.UI.Window.prototype.initialize.call(this, _options);
this.on('resizing', _.bind(this.onWindowResizing, this));
this.on('resize', _.bind(this.onWindowResize, this)); this.on('resize', _.bind(this.onWindowResize, this));
}, },
render: function () { render: function () {
@ -1370,16 +1371,27 @@ define([
return false; return false;
}, },
onWindowResize: function () { onWindowResize: function (args) {
if (args && args[1]=='start')
this.curSize = {resize: false, height: this.getSize()[1]};
else if (this.curSize.resize) {
var size = this.getSize();
this.$window.find('.combo-values').css({'height': size[1] - 100 + 'px'});
this.cellsList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true, suppressScrollX: true});
}
},
onWindowResizing: function () {
if (!this.curSize) return;
var size = this.getSize(); var size = this.getSize();
if (this.curSize === null) { if (size[1] !== this.curSize.height) {
this.curSize = size; if (!this.curSize.resize) {
} else { this.curSize.resize = true;
if (size[0] !== this.curSize[0] || size[1] !== this.curSize[1]) { this.cellsList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: false, suppressScrollX: true});
this.$window.find('.combo-values').css({'height': size[1] - 100 + 'px'});
this.curSize = size;
this.cellsList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true, suppressScrollX: true});
} }
this.$window.find('.combo-values').css({'height': size[1] - 100 + 'px'});
this.curSize.height = size[1];
} }
}, },