From c93bfa5e6f25ff3eb4e4ca19d8aae71cf5e1b239 Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Wed, 14 Aug 2019 13:58:58 +0300 Subject: [PATCH] [SSE] Memorize the selected filter window size for the current session --- .../main/app/view/AutoFilterDialog.js | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js index ce2342374..0fb9dd9b5 100644 --- a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js +++ b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js @@ -475,12 +475,16 @@ define([ SSE.Views.AutoFilterDialog = Common.UI.Window.extend(_.extend({ initialize: function (options) { - var t = this, _options = {}; + var t = this, _options = {}, width = undefined, height = undefined; + if (Common.Utils.InternalSettings.get('sse-settings-size-filter-window')) { + width = Common.Utils.InternalSettings.get('sse-settings-size-filter-window')[0]; + height = Common.Utils.InternalSettings.get('sse-settings-size-filter-window')[1]; + } _.extend(_options, { - width : 450, - height : 265, - contentWidth : 400, + width : width || 450, + height : height || 265, + contentWidth : (width - 50) || 400, header : false, cls : 'filter-dlg', contentTemplate : '', @@ -489,8 +493,8 @@ define([ animate : false, items : [], resizable : true, - minwidth : 450, - minheight : 265 + minwidth : 450, + minheight : 265 }, options); this.template = options.template || [ @@ -811,6 +815,11 @@ define([ _.delay(function () { $(document.body).on('mousedown', checkDocumentClick); }, 100, this); + + if(Common.Utils.InternalSettings.get('sse-settings-size-filter-window')) { + this.$window.find('.combo-values').css({'height': Common.Utils.InternalSettings.get('sse-settings-size-filter-window')[1] - 100 + 'px'}); + this.cellsList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true, suppressScrollX: true}); + } }, show: function (x, y) { @@ -1394,6 +1403,7 @@ define([ this.$window.find('.combo-values').css({'height': size[1] - 100 + 'px'}); this.curSize.height = size[1]; } + Common.Utils.InternalSettings.set('sse-settings-size-filter-window', size); }, okButtonText : 'Ok',