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([
var options = {};
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);
application.getController('Toolbar').hideElements(options);
} else
rightmenuController.getView('RightMenu').hide();
......
......@@ -156,7 +156,7 @@ define([
// Create toolbar view
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) {
......@@ -1152,6 +1152,7 @@ define([
var me = this;
this.toolbar.createDelayedElements();
this.onToolbarAfterRender(this.toolbar);
this.api.asc_registerCallback('asc_onShowChartDialog', _.bind(this.onApiChartDblClick, this));
this.api.asc_registerCallback('asc_onCanUndoChanged', _.bind(this.onApiCanRevert, this, 'undo'));
......@@ -1448,6 +1449,7 @@ define([
case 2: // FitPage
case 0:
default: {
this.toolbar.mnuZoom.options.value = percent;
$('.menu-zoom .zoom', this.toolbar.el).html(Math.floor((zf + .005) * 100) + '%');
}
}
......@@ -1455,13 +1457,9 @@ define([
onApiSheetChanged: function() {
if (this.api) {
var params = this.api.asc_getSheetViewSettings(),
menu = this.toolbar.btnShowMode.menu;
if (menu) {
menu.items[3].setChecked(!params.asc_getShowRowColHeaders());
menu.items[4].setChecked(!params.asc_getShowGridLines());
}
var params = this.api.asc_getSheetViewSettings();
this.toolbar.mnuitemHideHeadings.setChecked(!params.asc_getShowRowColHeaders());
this.toolbar.mnuitemHideGridlines.setChecked(!params.asc_getShowGridLines());
}
},
......@@ -1912,9 +1910,11 @@ define([
this._state.clrtext_asccolor = undefined;
this._state.clrshd_asccolor = undefined;
updateColors(this.toolbar.mnuBorderColorPicker, Common.Utils.ThemeColor.getEffectColors()[1]);
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);
if (this.toolbar.mnuBorderColorPicker) {
updateColors(this.toolbar.mnuBorderColorPicker, Common.Utils.ThemeColor.getEffectColors()[1]);
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) {
......
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