[SSE] Add resize window filter

This commit is contained in:
Julia Svinareva 2019-08-09 10:34:19 +03:00
parent d9142db8a1
commit 106289615b

View file

@ -487,16 +487,19 @@ define([
title : t.txtTitle, title : t.txtTitle,
modal : false, modal : false,
animate : false, animate : false,
items : [] items : [],
resizable : true,
minwidth : 450,
minheight : 265
}, options); }, options);
this.template = options.template || [ this.template = options.template || [
'<div class="box" style="height:' + _options.height + 'px;">', '<div class="box" style="height: 100%; display: flex; justify-content: space-between;">',
'<div class="content-panel" style="width: 250px;">', '<div class="content-panel" style="width: 100%; border-right: 1px solid #cbcbcb; display: flex; flex-direction: column; justify-content: space-between;">',
'<div class="">', '<div class="" style="display: flex; flex-direction: column; justify-content: flex-start; height: calc(100% - 40px);">',
'<div id="id-sd-cell-search" style="height:22px; margin-bottom:10px;"></div>', '<div id="id-sd-cell-search" style="height:22px; margin-bottom:10px;"></div>',
'<div class="border-values" style="">', '<div class="border-values" style="overflow: hidden; flex-grow: 1;">',
'<div id="id-dlg-filter-values" class="combo-values"/>', '<div id="id-dlg-filter-values" class="combo-values" style=""/>',
'</div>', '</div>',
'</div>', '</div>',
'<div class="footer center">', '<div class="footer center">',
@ -504,8 +507,7 @@ define([
'<button class="btn normal dlg-btn" result="cancel">', t.cancelButtonText, '</button>', '<button class="btn normal dlg-btn" result="cancel">', t.cancelButtonText, '</button>',
'</div>', '</div>',
'</div>', '</div>',
'<div class="separator"/>', '<div class="menu-panel" style="width: 195px; float: right;">',
'<div class="menu-panel" style="width: 195px;">',
'<div id="menu-container-filters" style=""><div class="dropdown-toggle" data-toggle="dropdown"></div></div>', '<div id="menu-container-filters" style=""><div class="dropdown-toggle" data-toggle="dropdown"></div></div>',
'</div>', '</div>',
'</div>' '</div>'
@ -515,10 +517,13 @@ define([
this.handler = options.handler; this.handler = options.handler;
this.throughIndexes = []; this.throughIndexes = [];
this.filteredIndexes = []; this.filteredIndexes = [];
this.curSize = undefined;
_options.tpl = _.template(this.template)(_options); _options.tpl = _.template(this.template)(_options);
Common.UI.Window.prototype.initialize.call(this, _options); Common.UI.Window.prototype.initialize.call(this, _options);
this.on('resize', _.bind(this.onWindowResize, this));
}, },
render: function () { render: function () {
@ -526,6 +531,12 @@ define([
Common.UI.Window.prototype.render.call(this); Common.UI.Window.prototype.render.call(this);
var $border = this.$window.find('.resize-border');
this.$window.find('.resize-border.left, .resize-border.top').css({'cursor': 'default'});
$border.removeClass('left');
$border.removeClass('top');
this.$window.find('.btn').on('click', _.bind(this.onBtnClick, this)); this.$window.find('.btn').on('click', _.bind(this.onBtnClick, this));
this.btnOk = new Common.UI.Button({ this.btnOk = new Common.UI.Button({
@ -1359,6 +1370,14 @@ define([
return false; return false;
}, },
onWindowResize: function () {
var size = this.getSize();
if (size !== this.curSize) {
this.$window.find('.combo-values').css({'height': size[1]-100 + 'px'});
this.curSize = size;
}
},
okButtonText : 'Ok', okButtonText : 'Ok',
btnCustomFilter : 'Custom Filter', btnCustomFilter : 'Custom Filter',
textSelectAll : 'Select All', textSelectAll : 'Select All',