Commit d5b1e451 authored by Julia Radzhabova's avatar Julia Radzhabova

[SSE] Delayed loading for the menu of some buttons. Don't read settings for...

[SSE] Delayed loading for the menu of some buttons. Don't read settings for hiding headings from local storage.
parent 0256616e
...@@ -918,7 +918,6 @@ define([ ...@@ -918,7 +918,6 @@ define([
var options = {}; var options = {};
JSON.parse(Common.localStorage.getItem('sse-hidden-title')) && (options.title = true); 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-formula')) && (options.formula = true);
JSON.parse(Common.localStorage.getItem('sse-hidden-headings')) && (options.headings = true);
application.getController('Toolbar').hideElements(options); application.getController('Toolbar').hideElements(options);
} else } else
rightmenuController.getView('RightMenu').hide(); rightmenuController.getView('RightMenu').hide();
......
...@@ -156,7 +156,7 @@ define([ ...@@ -156,7 +156,7 @@ define([
// Create toolbar view // Create toolbar view
this.toolbar = this.createView('Toolbar'); this.toolbar = this.createView('Toolbar');
this.toolbar.on('render:after', _.bind(this.onToolbarAfterRender, this)); // this.toolbar.on('render:after', _.bind(this.onToolbarAfterRender, this));
}, },
onToolbarAfterRender: function(toolbar) { onToolbarAfterRender: function(toolbar) {
...@@ -1152,6 +1152,7 @@ define([ ...@@ -1152,6 +1152,7 @@ define([
var me = this; var me = this;
this.toolbar.createDelayedElements(); this.toolbar.createDelayedElements();
this.onToolbarAfterRender(this.toolbar);
this.api.asc_registerCallback('asc_onShowChartDialog', _.bind(this.onApiChartDblClick, this)); this.api.asc_registerCallback('asc_onShowChartDialog', _.bind(this.onApiChartDblClick, this));
this.api.asc_registerCallback('asc_onCanUndoChanged', _.bind(this.onApiCanRevert, this, 'undo')); this.api.asc_registerCallback('asc_onCanUndoChanged', _.bind(this.onApiCanRevert, this, 'undo'));
...@@ -1448,6 +1449,7 @@ define([ ...@@ -1448,6 +1449,7 @@ define([
case 2: // FitPage case 2: // FitPage
case 0: case 0:
default: { default: {
this.toolbar.mnuZoom.options.value = percent;
$('.menu-zoom .zoom', this.toolbar.el).html(Math.floor((zf + .005) * 100) + '%'); $('.menu-zoom .zoom', this.toolbar.el).html(Math.floor((zf + .005) * 100) + '%');
} }
} }
...@@ -1455,13 +1457,9 @@ define([ ...@@ -1455,13 +1457,9 @@ define([
onApiSheetChanged: function() { onApiSheetChanged: function() {
if (this.api) { if (this.api) {
var params = this.api.asc_getSheetViewSettings(), var params = this.api.asc_getSheetViewSettings();
menu = this.toolbar.btnShowMode.menu; this.toolbar.mnuitemHideHeadings.setChecked(!params.asc_getShowRowColHeaders());
this.toolbar.mnuitemHideGridlines.setChecked(!params.asc_getShowGridLines());
if (menu) {
menu.items[3].setChecked(!params.asc_getShowRowColHeaders());
menu.items[4].setChecked(!params.asc_getShowGridLines());
}
} }
}, },
...@@ -1912,9 +1910,11 @@ define([ ...@@ -1912,9 +1910,11 @@ define([
this._state.clrtext_asccolor = undefined; this._state.clrtext_asccolor = undefined;
this._state.clrshd_asccolor = undefined; this._state.clrshd_asccolor = undefined;
updateColors(this.toolbar.mnuBorderColorPicker, Common.Utils.ThemeColor.getEffectColors()[1]); if (this.toolbar.mnuBorderColorPicker) {
this.toolbar.btnBorders.options.borderscolor = this.toolbar.mnuBorderColorPicker.currentColor.color || this.toolbar.mnuBorderColorPicker.currentColor; updateColors(this.toolbar.mnuBorderColorPicker, Common.Utils.ThemeColor.getEffectColors()[1]);
$('#id-toolbar-mnu-item-border-color .menu-item-icon').css('border-color', '#' + this.toolbar.btnBorders.options.borderscolor); this.toolbar.btnBorders.options.borderscolor = this.toolbar.mnuBorderColorPicker.currentColor.color || this.toolbar.mnuBorderColorPicker.currentColor;
$('#id-toolbar-mnu-item-border-color .menu-item-icon').css('border-color', '#' + this.toolbar.btnBorders.options.borderscolor);
}
}, },
hideElements: function(opts) { hideElements: function(opts) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment