From 8175ea22ce63db6dff3c50ba436887b68d71679c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 27 Jun 2019 19:48:45 +0300 Subject: [PATCH 1/3] [SSE] Auto filters: show filtered cells count --- apps/common/main/lib/component/Scroller.js | 5 +++++ .../main/app/view/AutoFilterDialog.js | 14 +++++++++++--- .../main/resources/less/filterdialog.less | 6 ++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/apps/common/main/lib/component/Scroller.js b/apps/common/main/lib/component/Scroller.js index 05c2ba80e..53e3783dd 100644 --- a/apps/common/main/lib/component/Scroller.js +++ b/apps/common/main/lib/component/Scroller.js @@ -165,7 +165,12 @@ define([ $(this.el).find('.ps-scrollbar-y-rail').removeClass('always-visible-y'); $(this.el).find('.ps-scrollbar-y').addClass('always-visible-y'); } + }, + + isVisible: function() { + return $(this.el).find('.ps-scrollbar-y-rail').is(':visible'); } + }), { isMouseCapture: function() { return mouseCapture diff --git a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js index 71a36ce1b..4993866f1 100644 --- a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js +++ b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js @@ -756,7 +756,12 @@ define([ '', '<% } %>', '', - '
<%= Common.Utils.String.htmlEncode(value) %>
', + '
', + '
<%= Common.Utils.String.htmlEncode(value) %>
', + '<% if (typeof count !=="undefined" && count) { %>', + '
<%= count%>
', + '<% } %>', + '
', '' ].join('')) }); @@ -1195,7 +1200,7 @@ define([ } var me = this, - isnumber, value, + isnumber, value, count, index = 0, throughIndex = 2, applyfilter = true, selectAllState = false, @@ -1207,6 +1212,7 @@ define([ value = item.asc_getText(); isnumber = isNumeric(value); applyfilter = true; + // count = item.asc_getCount();//Math.floor(Math.random() * 5000 + 1); if (me.filter) { if (null === value.match(me.filter)) { @@ -1227,7 +1233,8 @@ define([ strval : !isnumber ? value : '', groupid : '1', check : idxs[throughIndex], - throughIndex : throughIndex + throughIndex : throughIndex, + count: count ? count.toString() : '' })); if (idxs[throughIndex]) selectedCells++; } else { @@ -1278,6 +1285,7 @@ define([ } this.btnOk.setDisabled(this.cells.length<1); this.cellsList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true, suppressScrollX: true}); + this.cellsList.cmpEl.toggleClass('scroll-padding', this.cellsList.scroller.isVisible()); }, testFilter: function () { diff --git a/apps/spreadsheeteditor/main/resources/less/filterdialog.less b/apps/spreadsheeteditor/main/resources/less/filterdialog.less index fd43d743a..1c3b82bb2 100644 --- a/apps/spreadsheeteditor/main/resources/less/filterdialog.less +++ b/apps/spreadsheeteditor/main/resources/less/filterdialog.less @@ -8,6 +8,12 @@ .list-item { word-break: break-all; } + + &.scroll-padding { + .item { + padding-right: 14px; + } + } } .border-values { From f364b0a16c7e93283ba023fd855723afc5f3d727 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 28 Jun 2019 13:08:51 +0300 Subject: [PATCH 2/3] [SSE] Show filtered cells count --- apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js index 4993866f1..196f9c912 100644 --- a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js +++ b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js @@ -1212,7 +1212,7 @@ define([ value = item.asc_getText(); isnumber = isNumeric(value); applyfilter = true; - // count = item.asc_getCount();//Math.floor(Math.random() * 5000 + 1); + count = item.asc_getRepeats(); if (me.filter) { if (null === value.match(me.filter)) { From e84003bff0a386f313d30c074e85d324ec3bb625 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 28 Jun 2019 16:05:23 +0300 Subject: [PATCH 3/3] [SSE] Refactoring filtered cells count --- apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js index 196f9c912..415df6b02 100644 --- a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js +++ b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js @@ -1212,7 +1212,7 @@ define([ value = item.asc_getText(); isnumber = isNumeric(value); applyfilter = true; - count = item.asc_getRepeats(); + count = item.asc_getRepeats ? item.asc_getRepeats() : undefined; if (me.filter) { if (null === value.match(me.filter)) {