Merge pull request #493 from ONLYOFFICE/fix/bugfix

Fix/bugfix
This commit is contained in:
Julia Radzhabova 2020-09-01 17:34:26 +03:00 committed by GitHub
commit 6c600791da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 16 deletions

View file

@ -1225,7 +1225,7 @@ define([
this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
this.appOptions.canEditStyles = this.appOptions.canLicense && this.appOptions.canEdit;
this.appOptions.canPrint = (this.permissions.print !== false);
this.appOptions.canRename = this.editorConfig.canRename && !!this.permissions.rename;
this.appOptions.canRename = this.editorConfig.canRename && (this.permissions.rename!==false);
this.appOptions.buildVersion = params.asc_getBuildVersion();
this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
this.appOptions.forcesave = this.appOptions.canForcesave;
@ -1286,6 +1286,8 @@ define([
if (this.permissions.changeHistory !== undefined)
console.warn("Obsolete: The changeHistory parameter of the document permission section is deprecated. Please use onRequestRestore event instead.");
if (this.permissions.rename !== undefined)
console.warn("Obsolete: The rename parameter of the document permission section is deprecated. Please use onRequestRename event instead.");
},
applyModeCommonElements: function() {

View file

@ -949,7 +949,7 @@ define([
this.appOptions.canViewComments = this.appOptions.canComments || !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
this.appOptions.canPrint = (this.permissions.print !== false);
this.appOptions.canRename = this.editorConfig.canRename && !!this.permissions.rename;
this.appOptions.canRename = this.editorConfig.canRename && (this.permissions.rename!==false);
this.appOptions.canForcesave = this.appOptions.isEdit && !this.appOptions.isOffline && (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave);
this.appOptions.forcesave = this.appOptions.canForcesave;
this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly);
@ -981,6 +981,9 @@ define([
this.api.asc_setViewMode(!this.appOptions.isEdit && !this.appOptions.isRestrictedEdit);
(this.appOptions.isRestrictedEdit && this.appOptions.canComments) && this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyComments);
this.api.asc_LoadDocument();
if (this.permissions.rename !== undefined)
console.warn("Obsolete: The rename parameter of the document permission section is deprecated. Please use onRequestRename event instead.");
},
applyModeCommonElements: function() {

View file

@ -1011,7 +1011,7 @@ define([
this.appOptions.canComments = this.appOptions.canComments && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
this.appOptions.canViewComments = this.appOptions.canComments || !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.comments===false);
this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false);
this.appOptions.canRename = this.editorConfig.canRename && !!this.permissions.rename;
this.appOptions.canRename = this.editorConfig.canRename && (this.permissions.rename!==false);
this.appOptions.trialMode = params.asc_getLicenseMode();
this.appOptions.canModifyFilter = (this.permissions.modifyFilter!==false);
this.appOptions.canBranding = params.asc_getCustomization();
@ -1019,6 +1019,8 @@ define([
this.headerView.setBranding(this.editorConfig.customization);
this.appOptions.canRename && this.headerView.setCanRename(true);
if (this.permissions.rename !== undefined)
console.warn("Obsolete: The rename parameter of the document permission section is deprecated. Please use onRequestRename event instead.");
} else
this.appOptions.canModifyFilter = true;

View file

@ -1694,12 +1694,6 @@ define([
_setDefaults: function() {
this.initialFilterType = this.configTo.asc_getFilterObj().asc_getType();
var menuPanel = this.$window.find('.menu-panel');
this.menuPanelWidth = menuPanel.innerWidth();
var width = this.getWidth();
if (Common.Utils.InternalSettings.get('sse-settings-size-filter-window')) {
width = Common.Utils.InternalSettings.get('sse-settings-size-filter-window')[0] + this.menuPanelWidth;
}
var pivotObj = this.configTo.asc_getPivotObj(),
isPivot = !!pivotObj,
isValueFilter = false;
@ -1709,18 +1703,11 @@ define([
this.miSortOptions.setVisible(isPivot);
if (isPivot) {
if (pivotObj.asc_getIsPageFilter()) {
this.setResizable(true, [this.initConfig.minwidth - this.menuPanelWidth, this.initConfig.minheight]);
menuPanel.addClass('hidden');
width -= this.menuPanelWidth;
this.menuPanelWidth = 0;
}
this.miReapplySeparator.setVisible(false);
this.miReapply.setVisible(false);
isValueFilter = (pivotObj.asc_getDataFieldIndexFilter()!==0);
}
this.setSize(width, this.getHeight());
var filterObj = this.configTo.asc_getFilterObj(),
isCustomFilter = (this.initialFilterType === Asc.c_oAscAutoFilterTypes.CustomFilters),
@ -1833,6 +1820,23 @@ define([
this.miClear.setDisabled(this.initialFilterType === Asc.c_oAscAutoFilterTypes.None);
this.miReapply.setDisabled(this.initialFilterType === Asc.c_oAscAutoFilterTypes.None);
this.btnOk.setDisabled(this.initialFilterType !== Asc.c_oAscAutoFilterTypes.Filters && this.initialFilterType !== Asc.c_oAscAutoFilterTypes.None);
this.menuPanelWidth = menuPanel.innerWidth();
var width = this.getWidth();
if (width-this.menuPanelWidth<260) {
width = Math.ceil(this.menuPanelWidth + 260);
this.setResizable(true, [width, this.initConfig.minheight]);
}
if (Common.Utils.InternalSettings.get('sse-settings-size-filter-window')) {
width = Common.Utils.InternalSettings.get('sse-settings-size-filter-window')[0] + this.menuPanelWidth;
}
if (isPivot && pivotObj.asc_getIsPageFilter()) {
this.setResizable(true, [this.initConfig.minwidth - this.menuPanelWidth, this.initConfig.minheight]);
menuPanel.addClass('hidden');
width -= this.menuPanelWidth;
this.menuPanelWidth = 0;
}
this.setSize(width, this.getHeight());
},
setupDataCells: function() {