Load initial value for compact toolbar from editor config.

This commit is contained in:
Julia Radzhabova 2016-09-13 15:03:32 +03:00
parent 428bddd013
commit 4e72c53a8a
4 changed files with 7 additions and 5 deletions

View file

@ -106,7 +106,8 @@
},
chat: false,
comments: false,
zoom: 100
zoom: 100,
compactToolbar: false
},
plugins: {
url: '../../../../sdkjs-plugins/',

View file

@ -983,7 +983,7 @@ define([
this.btnPageMargins.menu.items[0].setVisible(false);
var value = Common.localStorage.getItem("de-compact-toolbar");
var valueCompact = (value !== null && parseInt(value) == 1);
var valueCompact = !!(value !== null && parseInt(value) == 1 || value === null && mode.customization && mode.customization.compactToolbar);
me.$el.html(this.template({
isCompactView: valueCompact
@ -1406,7 +1406,7 @@ define([
/**/
var mode = this.mode;
var value = Common.localStorage.getItem("de-compact-toolbar");
var valueCompact = (value !== null && parseInt(value) == 1);
var valueCompact = !!(value !== null && parseInt(value) == 1 || value === null && this.mode.customization && this.mode.customization.compactToolbar);
value = Common.localStorage.getItem("de-hidden-title");
var valueTitle = (value !== null && parseInt(value) == 1);

View file

@ -1139,7 +1139,7 @@ define([
this.trigger('render:before', this);
var value = Common.localStorage.getItem('pe-compact-toolbar');
var valueCompact = (value!==null && parseInt(value) == 1);
var valueCompact = !!(value!==null && parseInt(value) == 1 || value === null && mode.customization && mode.customization.compactToolbar);
value = Common.localStorage.getItem('pe-hidden-title');
var valueTitle = (value!==null && parseInt(value) == 1);

View file

@ -1523,7 +1523,8 @@ define([
JSON.parse(Common.localStorage.getItem('sse-hidden-title')) && (options.title = true);
JSON.parse(Common.localStorage.getItem('sse-hidden-formula')) && (options.formula = true);
JSON.parse(Common.localStorage.getItem('sse-hidden-headings')) && (options.headings = true);
var isCompactView = !!JSON.parse(Common.localStorage.getItem('sse-toolbar-compact'));
var isCompactView = JSON.parse(Common.localStorage.getItem('sse-toolbar-compact'));
isCompactView = !!(isCompactView!==null && parseInt(isCompactView) == 1 || isCompactView === null && mode.customization && mode.customization.compactToolbar);
me.mnuitemCompactToolbar.setChecked(isCompactView);
me.mnuitemHideTitleBar.setChecked(!!options.title);