diff --git a/apps/common/main/lib/component/ComboDataView.js b/apps/common/main/lib/component/ComboDataView.js index d2b1e9b3e..ff31ae0aa 100644 --- a/apps/common/main/lib/component/ComboDataView.js +++ b/apps/common/main/lib/component/ComboDataView.js @@ -414,10 +414,11 @@ define([ } } - me.fieldPicker.store.reset([]); // remove all + var indexRec = store.indexOf(record); + if (indexRec < 0) + return; - var indexRec = store.indexOf(record), - countRec = store.length, + var countRec = store.length, maxViewCount = Math.floor(Math.max(fieldPickerEl.width(), me.minWidth) / (me.itemWidth + (me.itemMarginLeft || 0) + (me.itemMarginRight || 0) + (me.itemPaddingLeft || 0) + (me.itemPaddingRight || 0) + (me.itemBorderLeft || 0) + (me.itemBorderRight || 0))), newStyles = []; @@ -425,9 +426,6 @@ define([ if (fieldPickerEl.height() / me.itemHeight > 2) maxViewCount *= Math.floor(fieldPickerEl.height() / me.itemHeight); - if (indexRec < 0) - return; - indexRec = Math.floor(indexRec / maxViewCount) * maxViewCount; if (countRec - indexRec < maxViewCount) indexRec = Math.max(countRec - maxViewCount, 0); @@ -435,7 +433,7 @@ define([ newStyles.push(store.at(index)); } - me.fieldPicker.store.add(newStyles); + me.fieldPicker.store.reset(newStyles); } if (forceSelect) { diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 23ad1c6d5..1dea4daf6 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -310,6 +310,7 @@ define([ toolbar.btnCopyStyle.on('toggle', _.bind(this.onCopyStyleToggle, this)); toolbar.mnuPageSize.on('item:click', _.bind(this.onPageSizeClick, this)); toolbar.mnuColorSchema.on('item:click', _.bind(this.onColorSchemaClick, this)); + toolbar.mnuColorSchema.on('show:after', _.bind(this.onColorSchemaShow, this)); toolbar.btnMailRecepients.on('click', _.bind(this.onSelectRecepientsClick, this)); toolbar.mnuInsertChartPicker.on('item:click', _.bind(this.onSelectChart, this)); toolbar.mnuPageNumberPosPicker.on('item:click', _.bind(this.onInsertPageNumberClick, this)); @@ -1591,6 +1592,14 @@ define([ Common.NotificationCenter.trigger('edit:complete', this.toolbar); }, + onColorSchemaShow: function(menu) { + if (this.api) { + var value = this.api.asc_GetCurrentColorSchemeName(); + var item = _.find(menu.items, function(item) { return item.value == value; }); + (item) ? item.setChecked(true) : menu.clearAll(); + } + }, + onDropCapSelect: function(menu, item) { if (_.isUndefined(item.value)) return; @@ -2668,17 +2677,17 @@ define([ return; } - listStyles.menuPicker.store.reset([]); // remove all - + var arr = []; var mainController = this.getApplication().getController('Main'); _.each(styles.get_MergedStyles(), function(style){ - listStyles.menuPicker.store.add({ + arr.push({ imageUrl: style.asc_getImage(), title : style.get_Name(), tip : mainController.translationTable[style.get_Name()] || style.get_Name(), id : Common.UI.getId() }); }); + listStyles.menuPicker.store.reset(arr); // remove all if (listStyles.menuPicker.store.length > 0 && listStyles.rendered){ var styleRec; diff --git a/apps/documenteditor/main/app/template/ParagraphSettingsAdvanced.template b/apps/documenteditor/main/app/template/ParagraphSettingsAdvanced.template index 603f9d24b..c510b0b83 100644 --- a/apps/documenteditor/main/app/template/ParagraphSettingsAdvanced.template +++ b/apps/documenteditor/main/app/template/ParagraphSettingsAdvanced.template @@ -5,7 +5,7 @@
-