diff --git a/apps/common/main/lib/component/ComboDataView.js b/apps/common/main/lib/component/ComboDataView.js index 33903aadf..6bf42af17 100644 --- a/apps/common/main/lib/component/ComboDataView.js +++ b/apps/common/main/lib/component/ComboDataView.js @@ -401,7 +401,7 @@ define([ fillComboView: function(record, forceSelect, forceFill) { if (!_.isUndefined(record) && record instanceof Backbone.Model){ - this.needFillComboView = false; + this.needFillComboView = !this.isVisible(); var me = this, store = me.menuPicker.store, diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 6040ceac2..471cbcccd 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -106,7 +106,8 @@ define([ this.addListeners({ 'Toolbar': { 'insert:break' : this.onClickPageBreak, - 'change:compact' : this.onClickChangeCompact + 'change:compact' : this.onClickChangeCompact, + 'home:open' : this.onHomeOpen }, 'FileMenu': { 'menu:hide': this.onFileMenu.bind(this, 'hide'), @@ -2608,6 +2609,15 @@ define([ window.styles_loaded = true; }, + onHomeOpen: function() { + var listStyles = this.toolbar.listStyles; + if (listStyles && listStyles.needFillComboView && listStyles.menuPicker.store.length > 0 && listStyles.rendered){ + var styleRec; + if (this._state.prstyle) styleRec = listStyles.menuPicker.store.findWhere({title: this._state.prstyle}); + listStyles.fillComboView((styleRec) ? styleRec : listStyles.menuPicker.store.at(0), true); + } + }, + _setMarkerColor: function(strcolor, h) { var me = this; diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 95370d5d2..24c88d32b 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1227,6 +1227,9 @@ define([ } Common.UI.Mixtbar.prototype.onTabClick.apply(me, arguments); + + if ( me.isTabActive('home')) + me.fireEvent('home:open'); }, rendererComponents: function (html) {