From ed45c1fe0eb05ddda60517269dc1f3684c50d012 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 4 Mar 2021 01:11:57 +0300 Subject: [PATCH] [SSE] Fix custom icons settings --- .../main/app/view/FormatRulesEditDlg.js | 45 +++++++++++++------ 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js b/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js index e57704003..0dc6938d8 100644 --- a/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js +++ b/apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js @@ -1070,16 +1070,16 @@ define([ }); // Icons - var collectionPresets = SSE.getCollection('ConditionalFormatIconsPresets'); - if (collectionPresets.length<1) + this.collectionPresets = SSE.getCollection('ConditionalFormatIconsPresets'); + if (this.collectionPresets.length<1) SSE.getController('Main').fillCondFormatIconsPresets(this.api.asc_getCFIconsByType()); - var collectionIcons = SSE.getCollection('ConditionalFormatIcons'); - if (collectionIcons.length<1) + this.collectionIcons = SSE.getCollection('ConditionalFormatIcons'); + if (this.collectionIcons.length<1) SSE.getController('Main').fillCondFormatIcons(this.api.asc_getFullCFIcons()); arr = []; - var len = collectionPresets.length; + var len = this.collectionPresets.length; var iconsPresets = this.api.asc_getCFPresets()[Asc.c_oAscCFRuleTypeSettings.icons]; _.each(iconsPresets, function(preset, index){ if (index>=len) return; @@ -1097,9 +1097,9 @@ define([ arr.push({ value: index, data : { - iconSet: collectionPresets.at(index).get('icons'), + iconSet: me.collectionPresets.at(index).get('icons'), values: values, - icons: collectionIcons + icons: me.collectionIcons } }); }); @@ -1132,7 +1132,7 @@ define([ }); var icons = []; - collectionIcons.each(function(icon, index){ + me.collectionIcons.each(function(icon, index){ icons.push({ value: icon.get('index'), imgUrl: icon.get('icon') @@ -1557,7 +1557,20 @@ define([ value.asc_setGte(controls.cmbOperator.getValue()); values.push(value); if (icons) { - this.iconsProps.isReverse ? icons.unshift(controls.pickerIcons.getSelectedRec().get('value')+1) : icons.push(controls.pickerIcons.getSelectedRec().get('value')+1); + var icon = controls.pickerIcons.getSelectedRec().get('value')+1; + for (var k=0; k0) { this.cmbIconsPresets.setValue(this.textCustom); + _.each(icons, function(item) { + iconsIndexes.push(me.collectionPresets.at(item.asc_getIconSet()).get('icons')[item.asc_getIconId()]); + }); } else { this.cmbIconsPresets.setValue(iconSet); - var collectionPresets = SSE.getCollection('ConditionalFormatIconsPresets'); - icons = collectionPresets.at(iconSet).get('icons'); + iconsIndexes = me.collectionPresets.at(iconSet).get('icons'); } var isReverse = this.iconsProps.isReverse; - var len = icons.length; - for (var i=0; i