Merge pull request #704 from ONLYOFFICE/feature/hide-rulers

Add hideRulers parameter to customization
This commit is contained in:
Julia Radzhabova 2021-02-12 14:39:24 +03:00 committed by GitHub
commit fb8a6f1a98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 5 deletions

View file

@ -155,7 +155,8 @@
macros: true // can run macros in document
plugins: true // can run plugins in document
macrosMode: 'warn' // warn about automatic macros, 'enable', 'disable', 'warn',
trackChanges: undefined // true/false - open editor with track changes mode on/off
trackChanges: undefined // true/false - open editor with track changes mode on/off,
hideRulers: false, // hide or show rulers on first loading (presentation or document editor)
},
plugins: {
autostart: ['asc.{FFE1F462-1EA2-4391-990D-4CC84940B754}'],

View file

@ -1439,7 +1439,9 @@ define([
Common.Utils.InternalSettings.set("de-settings-unit", value);
me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));
me.api.asc_SetViewRulers(!Common.localStorage.getBool('de-hidden-rulers'));
value = Common.localStorage.itemExists('de-hidden-rulers') ? Common.localStorage.getBool('de-hidden-rulers') : (this.appOptions.customization && !!this.appOptions.customization.hideRulers);
Common.Utils.InternalSettings.set("de-hidden-rulers", value);
me.api.asc_SetViewRulers(!value);
me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me));
/** coauthoring begin **/

View file

@ -241,7 +241,7 @@ define([
var mnuitemHideRulers = new Common.UI.MenuItem({
caption: me.header.textHideLines,
checked: Common.localStorage.getBool("de-hidden-rulers"),
checked: Common.Utils.InternalSettings.get("de-hidden-rulers"),
checkable: true,
value: 'rulers'
});
@ -387,6 +387,7 @@ define([
case 'rulers':
me.api.asc_SetViewRulers(!item.isChecked());
Common.localStorage.setBool('de-hidden-rulers', item.isChecked());
Common.Utils.InternalSettings.set("de-hidden-rulers", item.isChecked());
Common.NotificationCenter.trigger('layout:changed', 'rulers');
Common.NotificationCenter.trigger('edit:complete', me.header);
break;

View file

@ -1135,7 +1135,9 @@ define([
Common.Utils.InternalSettings.set("pe-settings-unit", value);
me.api.asc_SetDocumentUnits((value==Common.Utils.Metric.c_MetricUnits.inch) ? Asc.c_oAscDocumentUnits.Inch : ((value==Common.Utils.Metric.c_MetricUnits.pt) ? Asc.c_oAscDocumentUnits.Point : Asc.c_oAscDocumentUnits.Millimeter));
if (me.api.asc_SetViewRulers) me.api.asc_SetViewRulers(!Common.localStorage.getBool('pe-hidden-rulers', true));
value = Common.localStorage.itemExists('pe-hidden-rulers') ? Common.localStorage.getBool('pe-hidden-rulers') : (!this.appOptions.customization || this.appOptions.customization.hideRulers!==false);
Common.Utils.InternalSettings.set("pe-hidden-rulers", value);
if (me.api.asc_SetViewRulers) me.api.asc_SetViewRulers(!value);
me.api.asc_registerCallback('asc_onChangeObjectLock', _.bind(me._onChangeObjectLock, me));
me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me));

View file

@ -244,7 +244,7 @@ define([
var mnuitemHideRulers = new Common.UI.MenuItem({
caption: me.header.textHideLines,
checked: Common.localStorage.getBool("pe-hidden-rulers", true),
checked: Common.Utils.InternalSettings.get("pe-hidden-rulers"),
checkable: true,
value: 'rulers'
});
@ -430,6 +430,7 @@ define([
case 'rulers':
me.api.asc_SetViewRulers(!item.isChecked());
Common.localStorage.setBool('pe-hidden-rulers', item.isChecked());
Common.Utils.InternalSettings.set("pe-hidden-rulers", item.isChecked());
Common.NotificationCenter.trigger('layout:changed', 'rulers');
Common.NotificationCenter.trigger('edit:complete', me.header);
break;