Merge pull request #202 from ONLYOFFICE/feature/sse-filter-count

Feature/sse filter count
This commit is contained in:
Julia Radzhabova 2019-06-28 16:08:17 +03:00 committed by GitHub
commit e1b61c55d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 3 deletions

View file

@ -165,7 +165,12 @@ define([
$(this.el).find('.ps-scrollbar-y-rail').removeClass('always-visible-y'); $(this.el).find('.ps-scrollbar-y-rail').removeClass('always-visible-y');
$(this.el).find('.ps-scrollbar-y').addClass('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() { isMouseCapture: function() {
return mouseCapture return mouseCapture

View file

@ -756,7 +756,12 @@ define([
'<input type="button" class="img-commonctrl"/>', '<input type="button" class="img-commonctrl"/>',
'<% } %>', '<% } %>',
'</label>', '</label>',
'<div id="<%= id %>" class="list-item" style="pointer-events:none;margin-left:20px;display:inline-block;width: 185px;"><%= Common.Utils.String.htmlEncode(value) %></div>', '<div id="<%= id %>" class="list-item" style="pointer-events:none; margin-left: 20px;display: flex;">',
'<div style="flex-grow: 1;"><%= Common.Utils.String.htmlEncode(value) %></div>',
'<% if (typeof count !=="undefined" && count) { %>',
'<div style="word-break: normal; margin-left: 10px; color: #afafaf;"><%= count%></div>',
'<% } %>',
'</div>',
'</div>' '</div>'
].join('')) ].join(''))
}); });
@ -1195,7 +1200,7 @@ define([
} }
var me = this, var me = this,
isnumber, value, isnumber, value, count,
index = 0, throughIndex = 2, index = 0, throughIndex = 2,
applyfilter = true, applyfilter = true,
selectAllState = false, selectAllState = false,
@ -1207,6 +1212,7 @@ define([
value = item.asc_getText(); value = item.asc_getText();
isnumber = isNumeric(value); isnumber = isNumeric(value);
applyfilter = true; applyfilter = true;
count = item.asc_getRepeats ? item.asc_getRepeats() : undefined;
if (me.filter) { if (me.filter) {
if (null === value.match(me.filter)) { if (null === value.match(me.filter)) {
@ -1227,7 +1233,8 @@ define([
strval : !isnumber ? value : '', strval : !isnumber ? value : '',
groupid : '1', groupid : '1',
check : idxs[throughIndex], check : idxs[throughIndex],
throughIndex : throughIndex throughIndex : throughIndex,
count: count ? count.toString() : ''
})); }));
if (idxs[throughIndex]) selectedCells++; if (idxs[throughIndex]) selectedCells++;
} else { } else {
@ -1278,6 +1285,7 @@ define([
} }
this.btnOk.setDisabled(this.cells.length<1); this.btnOk.setDisabled(this.cells.length<1);
this.cellsList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true, suppressScrollX: true}); this.cellsList.scroller.update({minScrollbarLength : 40, alwaysVisibleY: true, suppressScrollX: true});
this.cellsList.cmpEl.toggleClass('scroll-padding', this.cellsList.scroller.isVisible());
}, },
testFilter: function () { testFilter: function () {

View file

@ -8,6 +8,12 @@
.list-item { .list-item {
word-break: break-all; word-break: break-all;
} }
&.scroll-padding {
.item {
padding-right: 14px;
}
}
} }
.border-values { .border-values {