Merge pull request #1139 from ONLYOFFICE/fix/bugfix

Fix/bugfix
This commit is contained in:
Julia Radzhabova 2021-08-31 00:19:10 +03:00 committed by GitHub
commit f63e61528c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 33 additions and 64 deletions

View file

@ -214,40 +214,7 @@ const PluginsController = inject('storeAppOptions')(observer(props => {
plugins.forEach(item => {
let plugin = new Asc.CPlugin();
plugin.set_Name(item['name']);
plugin.set_Guid(item['guid']);
plugin.set_BaseUrl(item['baseUrl']);
plugin.set_MinVersion && plugin.set_MinVersion(item['minVersion']);
let variations = item['variations'],
variationsArr = [];
variations.forEach(itemVar => {
let variation = new Asc.CPluginVariation();
variation.set_Description(itemVar['description']);
variation.set_Url(itemVar['url']);
variation.set_Icons(itemVar['icons']);
variation.set_Visual(itemVar['isVisual']);
variation.set_CustomWindow(itemVar['isCustomWindow']);
variation.set_System(itemVar['isSystem']);
variation.set_Viewer(itemVar['isViewer']);
variation.set_EditorsSupport(itemVar['EditorsSupport']);
variation.set_Modal(itemVar['isModal']);
variation.set_InsideMode(itemVar['isInsideMode']);
variation.set_InitDataType(itemVar['initDataType']);
variation.set_InitData(itemVar['initData']);
variation.set_UpdateOleOnResize(itemVar['isUpdateOleOnResize']);
variation.set_Buttons(itemVar['buttons']);
variation.set_Size(itemVar['size']);
variation.set_InitOnSelectionChanged(itemVar['initOnSelectionChanged']);
variation.set_Events(itemVar['events']);
variationsArr.push(variation);
});
plugin["set_Variations"](variationsArr);
plugin.deserialize(item);
arr.push(plugin);
});

View file

@ -131,8 +131,8 @@ define([
this.rightmenu.fireEvent('editcomplete', this.rightmenu);
},
onFocusObject: function(SelectedObjects) {
if (!this.editMode)
onFocusObject: function(SelectedObjects, forceSignature) {
if (!this.editMode && !forceSignature)
return;
var open = this._initSettings ? !Common.localStorage.getBool("de-hide-right-settings", this.rightmenu.defaultHideRightMenu) : false;
@ -269,6 +269,7 @@ define([
if (priorityactive>-1) active = priorityactive;
else if (lastactive>=0 && currentactive<0) active = lastactive;
else if (currentactive>=0) active = currentactive;
else if (forceSignature && !this._settings[Common.Utils.documentSettingsType.Signature].hidden) active = Common.Utils.documentSettingsType.Signature;
else if (!this._settings[Common.Utils.documentSettingsType.MailMerge].hidden) active = Common.Utils.documentSettingsType.MailMerge;
if (active == undefined && open && lastactive>=0)
@ -423,8 +424,9 @@ define([
}
this.rightmenu.chartSettings.disableControls(disabled);
if (!allowSignature && this.rightmenu.signatureSettings) {
this.rightmenu.btnSignature.setDisabled(disabled);
if (this.rightmenu.signatureSettings) {
!allowSignature && this.rightmenu.btnSignature.setDisabled(disabled);
allowSignature && disabled && this.onFocusObject([], true); // force press signature button
}
if (disabled) {

View file

@ -1627,6 +1627,8 @@ define([
insertImage: function(data) { // gateway
if (data && (data.url || data.images)) {
data.url && console.log("Obsolete: The 'url' parameter of the 'insertImage' method is deprecated. Please use 'images' parameter instead.");
var arr = [];
if (data.images && data.images.length>0) {
for (var i=0; i<data.images.length; i++) {

View file

@ -400,7 +400,7 @@ define([
allowMerge: false,
allowSignature: true,
allowProtect: true,
rightMenu: {clear: disable && (DE.getController('RightMenu').rightmenu.GetActivePane() !== 'id-signature-settings'), disable: true},
rightMenu: {clear: false, disable: true},
statusBar: true,
leftMenu: {disable: false, previewMode: true},
fileMenu: false,

View file

@ -106,8 +106,8 @@ define([
this.rightmenu.fireEvent('editcomplete', this.rightmenu);
},
onFocusObject: function(SelectedObjects) {
if (!this.editMode)
onFocusObject: function(SelectedObjects, forceSignature) {
if (!this.editMode && !forceSignature)
return;
var open = this._initSettings ? !Common.localStorage.getBool("pe-hide-right-settings", this.rightmenu.defaultHideRightMenu) : false;
@ -194,6 +194,7 @@ define([
if (priorityactive>-1) active = priorityactive;
else if (currentactive>=0) active = currentactive;
else if (lastactive>=0) active = lastactive;
else if (forceSignature && !this._settings[Common.Utils.documentSettingsType.Signature].hidden) active = Common.Utils.documentSettingsType.Signature;
else active = Common.Utils.documentSettingsType.Slide;
if (active !== undefined) {
@ -226,8 +227,9 @@ define([
this.rightmenu.imageSettings.disableControls(disabled);
this.rightmenu.chartSettings.disableControls(disabled);
if (!allowSignature && this.rightmenu.signatureSettings) {
this.rightmenu.btnSignature.setDisabled(disabled);
if (this.rightmenu.signatureSettings) {
!allowSignature && this.rightmenu.btnSignature.setDisabled(disabled);
allowSignature && disabled && this.onFocusObject([], true); // force press signature button
}
if (disabled) {

View file

@ -1627,6 +1627,8 @@ define([
insertImage: function(data) { // gateway
if (data && (data.url || data.images)) {
data.url && console.log("Obsolete: The 'url' parameter of the 'insertImage' method is deprecated. Please use 'images' parameter instead.");
var arr = [];
if (data.images && data.images.length>0) {
for (var i=0; i<data.images.length; i++) {

View file

@ -350,7 +350,7 @@ define([
Common.NotificationCenter.trigger('editing:disable', disable, {
viewMode: disable,
allowSignature: true,
rightMenu: {clear: disable && (PE.getController('RightMenu').rightmenu.GetActivePane() !== 'id-signature-settings'), disable: true},
rightMenu: {clear: false, disable: true},
statusBar: true,
leftMenu: {disable: false, previewMode: true},
fileMenu: false,

View file

@ -168,14 +168,14 @@ define([
this.onFocusObject(SelectedObjects, cellInfo, formatTableInfo, sparkLineInfo, pivotInfo);
},
onFocusObject: function(SelectedObjects, cellInfo, formatTableInfo, sparkLineInfo, pivotInfo) {
if (!this.editMode)
onFocusObject: function(SelectedObjects, cellInfo, formatTableInfo, sparkLineInfo, pivotInfo, forceSignature) {
if (!this.editMode && !forceSignature)
return;
var isCellLocked = cellInfo.asc_getLocked() || this._state.wsProps['FormatCells'],
isTableLocked = (cellInfo.asc_getLockedTable()===true || !this.rightmenu.mode.canModifyFilter) || this._state.wsProps['FormatCells'],
isSparkLocked = (cellInfo.asc_getLockedSparkline()===true) || this._state.wsLock,
isPivotLocked = (cellInfo.asc_getLockedPivotTable()===true) || this._state.wsProps['PivotTables'];
var isCellLocked = cellInfo && cellInfo.asc_getLocked() || this._state.wsProps['FormatCells'],
isTableLocked = (cellInfo && cellInfo.asc_getLockedTable()===true || !this.rightmenu.mode.canModifyFilter) || this._state.wsProps['FormatCells'],
isSparkLocked = (cellInfo && cellInfo.asc_getLockedSparkline()===true) || this._state.wsLock,
isPivotLocked = (cellInfo && cellInfo.asc_getLockedPivotTable()===true) || this._state.wsProps['PivotTables'];
for (var i=0; i<this._settings.length; ++i) {
if (i==Common.Utils.documentSettingsType.Signature) continue;
@ -241,7 +241,7 @@ define([
this._settings[settingsType].hidden = 0;
}
if (SelectedObjects.length<=0) { // cell is selected
if (SelectedObjects.length<=0 && cellInfo) { // cell is selected
settingsType = Common.Utils.documentSettingsType.Cell;
this._settings[settingsType].props = cellInfo;
this._settings[settingsType].locked = isCellLocked;
@ -296,6 +296,7 @@ define([
if (priorityactive>-1) active = priorityactive;
else if (lastactive>=0 && currentactive<0) active = lastactive;
else if (currentactive>=0) active = currentactive;
else if (forceSignature && !this._settings[Common.Utils.documentSettingsType.Signature].hidden) active = Common.Utils.documentSettingsType.Signature;
if (active == undefined && this._openRightMenu && lastactive>=0)
active = lastactive;
@ -425,12 +426,9 @@ define([
this.rightmenu.cellSettings.disableControls(disabled);
this.rightmenu.slicerSettings.disableControls(disabled);
if (!allowSignature && this.rightmenu.signatureSettings) {
this.rightmenu.btnSignature.setDisabled(disabled);
}
if (!allowSignature && this.rightmenu.signatureSettings) {
this.rightmenu.btnSignature.setDisabled(disabled);
if (this.rightmenu.signatureSettings) {
!allowSignature && this.rightmenu.btnSignature.setDisabled(disabled);
allowSignature && disabled && this.onFocusObject([], undefined, undefined, undefined, undefined, true); // force press signature button
}
if (disabled) {

View file

@ -908,6 +908,8 @@ define([
insertImage: function(data) { // gateway
if (data && (data.url || data.images)) {
data.url && console.log("Obsolete: The 'url' parameter of the 'insertImage' method is deprecated. Please use 'images' parameter instead.");
var arr = [];
if (data.images && data.images.length>0) {
for (var i=0; i<data.images.length; i++) {

View file

@ -76,7 +76,6 @@ define([
});
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
Common.NotificationCenter.on('protect:sheet', _.bind(this.onSheetClick, this));
},
setConfig: function (data, api) {
@ -93,7 +92,6 @@ define([
this.api.asc_registerCallback('asc_onChangeProtectWorksheet',_.bind(this.onChangeProtectSheet, this));
this.api.asc_registerCallback('asc_onActiveSheetChanged', _.bind(this.onActiveSheetChanged, this));
this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onApiSelectionChanged, this));
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
}
},
@ -352,10 +350,6 @@ define([
}
}
}
},
onCoAuthoringDisconnect: function() {
this.SetDisabled(true);
}
}, SSE.Controllers.WBProtection || {}));

View file

@ -397,7 +397,7 @@ define([
viewMode: disable,
allowSignature: true,
allowProtect: true,
rightMenu: {clear: disable && (SSE.getController('RightMenu').rightmenu.GetActivePane() !== 'id-signature-settings'), disable: true},
rightMenu: {clear: false, disable: true},
statusBar: true,
leftMenu: {disable: false, previewMode: true},
fileMenu: false,