[SSE] Fix Bug 19709.

This commit is contained in:
Julia Radzhabova 2017-02-06 14:22:34 +03:00
parent ee4cb06c23
commit 1eae40c65b
5 changed files with 42 additions and 2 deletions

View file

@ -104,6 +104,7 @@ define([
this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onWorksheetLocked, this)); this.api.asc_registerCallback('asc_onWorksheetLocked', _.bind(this.onWorksheetLocked, this));
/** coauthoring end **/ /** coauthoring end **/
this.api.asc_registerCallback('asc_onError', _.bind(this.onError, this)); this.api.asc_registerCallback('asc_onError', _.bind(this.onError, this));
this.api.asc_registerCallback('asc_onFilterInfo', _.bind(this.onApiFilterInfo , this));
this.statusbar.setApi(api); this.statusbar.setApi(api);
}, },
@ -185,6 +186,11 @@ define([
this.statusbar.updateTabbarBorders(); this.statusbar.updateTabbarBorders();
}, },
onApiFilterInfo: function(countFilter, countRecords) {
this.statusbar.setFilteredInfo(countFilter, countRecords);
this.statusbar.updateTabbarBorders();
},
onApiEditCell: function(state) { onApiEditCell: function(state) {
var disableAdd = (state == Asc.c_oAscCellEditorState.editFormula), var disableAdd = (state == Asc.c_oAscCellEditorState.editFormula),
disable = (state != Asc.c_oAscCellEditorState.editEnd), disable = (state != Asc.c_oAscCellEditorState.editEnd),

View file

@ -1936,6 +1936,7 @@ define([
need_disable = this._state.controlsdisabled.filters || !filterInfo || (filterInfo.asc_getIsApplyAutoFilter()!==true); need_disable = this._state.controlsdisabled.filters || !filterInfo || (filterInfo.asc_getIsApplyAutoFilter()!==true);
toolbar.lockToolbar(SSE.enumLock.ruleDelFilter, need_disable, {array:[toolbar.btnClearAutofilter,toolbar.mnuitemClearFilter]}); toolbar.lockToolbar(SSE.enumLock.ruleDelFilter, need_disable, {array:[toolbar.btnClearAutofilter,toolbar.mnuitemClearFilter]});
this.getApplication().getController('Statusbar').onApiFilterInfo(!need_disable);
this._state.multiselect = info.asc_getFlags().asc_getMultiselect(); this._state.multiselect = info.asc_getFlags().asc_getMultiselect();
toolbar.lockToolbar(SSE.enumLock.multiselect, this._state.multiselect, { array: [toolbar.btnTableTemplate, toolbar.btnInsertHyperlink]}); toolbar.lockToolbar(SSE.enumLock.multiselect, this._state.multiselect, { array: [toolbar.btnTableTemplate, toolbar.btnInsertHyperlink]});

View file

@ -39,6 +39,10 @@
<label id="status-math-count">COUNT: 3</label> <label id="status-math-count">COUNT: 3</label>
<label id="status-math-sum">SUM: 5</label> <label id="status-math-sum">SUM: 5</label>
</div> </div>
<div id="status-filtered-box" class="status-group">
<div class="separator short" style="margin-right: 12px;" />
<label id="status-filtered-records"></label>
</div>
<div id="status-sheets-bar-box"> <div id="status-sheets-bar-box">
<div id="status-sheets-bar" class="status-group"> <div id="status-sheets-bar" class="status-group">
</div> </div>

View file

@ -323,6 +323,10 @@ define([
this.labelAverage = $('#status-math-average', this.boxMath); this.labelAverage = $('#status-math-average', this.boxMath);
this.boxMath.hide(); this.boxMath.hide();
this.boxFiltered = $('#status-filtered-box', this.el);
this.labelFiltered = $('#status-filtered-records', this.boxFiltered);
this.boxFiltered.hide();
this.boxZoom = $('#status-zoom-box', this.el); this.boxZoom = $('#status-zoom-box', this.el);
this.boxZoom.find('.separator').css('border-left-color','transparent'); this.boxZoom.find('.separator').css('border-left-color','transparent');
@ -426,6 +430,23 @@ define([
},30); },30);
}, },
setFilteredInfo: function(countFilter, countRecords) {
if (countFilter>0 && countRecords>0) {//filter is applied
if (!this.boxFiltered.is(':visible')) this.boxFiltered.show();
this.labelFiltered.text(Common.Utils.String.format(this.filteredRecordsText, countFilter, countRecords));
} else if (countFilter) {// filter mode
if (!this.boxFiltered.is(':visible')) this.boxFiltered.show();
this.labelFiltered.text(this.filteredText);
} else {
if (this.boxFiltered.is(':visible')) this.boxFiltered.hide();
}
var me = this;
_.delay(function(){
me.onTabInvisible(undefined, me.tabbar.checkInvisible(true));
},30);
},
/** coauthoring begin **/ /** coauthoring begin **/
onUsersClick: function() { onUsersClick: function() {
this.panelUsers.removeClass('open'); this.panelUsers.removeClass('open');
@ -600,6 +621,11 @@ define([
visible = true; visible = true;
} }
if (this.boxFiltered.is(':visible')) {
right += parseInt(this.boxFiltered.css('width'));
visible = true;
}
if (this.panelUsers.is(':visible')) { if (this.panelUsers.is(':visible')) {
right += parseInt(this.panelUsers.css('width')); right += parseInt(this.panelUsers.css('width'));
visible = true; visible = true;
@ -645,7 +671,9 @@ define([
tipUsers : 'Document is currently being edited by several users.', tipUsers : 'Document is currently being edited by several users.',
tipAccessRights : 'Manage document access rights', tipAccessRights : 'Manage document access rights',
tipViewUsers : 'View users and manage document access rights', tipViewUsers : 'View users and manage document access rights',
txAccessRights : 'Change access rights' txAccessRights : 'Change access rights',
filteredRecordsText : '{0} of {1} records filtered',
filteredText : 'Filter mode'
}, SSE.Views.Statusbar || {})); }, SSE.Views.Statusbar || {}));

View file

@ -119,7 +119,8 @@
height: 25px; height: 25px;
} }
#status-math-box { #status-math-box,
#status-filtered-box {
float: right; float: right;
padding-top: 6px; padding-top: 6px;
padding-right: 14px; padding-right: 14px;