From f714a26da75c96326626540cbcedee8b426c6aa7 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 19 Dec 2019 11:00:49 +0300 Subject: [PATCH] Change color scheme by index --- apps/documenteditor/main/app/controller/Toolbar.js | 4 ++-- apps/documenteditor/main/app/view/Toolbar.js | 2 +- apps/documenteditor/mobile/app/controller/Settings.js | 4 ++-- apps/presentationeditor/main/app/controller/Toolbar.js | 4 ++-- apps/presentationeditor/main/app/view/Toolbar.js | 2 +- apps/presentationeditor/mobile/app/controller/Settings.js | 4 ++-- apps/spreadsheeteditor/main/app/controller/Toolbar.js | 4 ++-- apps/spreadsheeteditor/main/app/view/Toolbar.js | 2 +- apps/spreadsheeteditor/mobile/app/controller/Settings.js | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index ca79f6432..1ebd5b26f 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -1606,7 +1606,7 @@ define([ onColorSchemaClick: function(menu, item) { if (this.api) { - this.api.ChangeColorScheme(item.value); + this.api.asc_ChangeColorSchemeByIdx(item.value); Common.component.Analytics.trackEvent('ToolBar', 'Color Scheme'); } @@ -1616,7 +1616,7 @@ define([ onColorSchemaShow: function(menu) { if (this.api) { - var value = this.api.asc_GetCurrentColorSchemeName(); + var value = this.api.asc_GetCurrentColorSchemeIndex(); var item = _.find(menu.items, function(item) { return item.value == value; }); (item) ? item.setChecked(true) : menu.clearAll(); } diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index a6c2c8493..eb0b47b2e 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1978,7 +1978,7 @@ define([ cls: 'color-schemas-menu', colors: schemecolors, caption: (index < 21) ? (me.SchemeNames[index] || name) : name, - value: name, + value: index, checkable: true, toggleGroup: 'menuSchema' }); diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 3d8ba1d8c..f8d781e32 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -357,7 +357,7 @@ define([ _.each(schemas, function (schema, index) { var colors = schema.get_colors(), //schema.colors; name = schema.get_name(); - templateInsert = templateInsert + "
"; + templateInsert = templateInsert + "
"; for (var j = 2; j < 7; j++) { var clr = '#' + Common.Utils.ThemeColor.getHexColor(colors[j].get_r(), colors[j].get_g(), colors[j].get_b()); templateInsert = templateInsert + "" @@ -369,7 +369,7 @@ define([ onColorSchemaClick: function(event) { if (this.api) { var name = $(event.currentTarget).children('input').val(); - this.api.ChangeColorScheme(name); + this.api.asc_ChangeColorSchemeByIdx(name); } }, diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 504d03865..1314ae1c3 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -1575,7 +1575,7 @@ define([ onColorSchemaClick: function(menu, item) { if (this.api) { - this.api.ChangeColorScheme(item.value); + this.api.asc_ChangeColorSchemeByIdx(item.value); Common.component.Analytics.trackEvent('ToolBar', 'Color Scheme'); } @@ -1585,7 +1585,7 @@ define([ onColorSchemaShow: function(menu) { if (this.api) { - var value = this.api.asc_GetCurrentColorSchemeName(); + var value = this.api.asc_GetCurrentColorSchemeIndex(); var item = _.find(menu.items, function(item) { return item.value == value; }); (item) ? item.setChecked(true) : menu.clearAll(); } diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 9b43161e4..26051856c 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1305,7 +1305,7 @@ define([ cls: 'color-schemas-menu', colors: schemecolors, caption: (index < 21) ? (me.SchemeNames[index] || name) : name, - value: name, + value: index, checkable: true, toggleGroup: 'menuSchema' }); diff --git a/apps/presentationeditor/mobile/app/controller/Settings.js b/apps/presentationeditor/mobile/app/controller/Settings.js index 5a126c67f..03ae22136 100644 --- a/apps/presentationeditor/mobile/app/controller/Settings.js +++ b/apps/presentationeditor/mobile/app/controller/Settings.js @@ -252,7 +252,7 @@ define([ _.each(schemas, function (schema, index) { var colors = schema.get_colors(),//schema.colors; name = schema.get_name(); - templateInsert = templateInsert + "
"; + templateInsert = templateInsert + "
"; for (var j = 2; j < 7; j++) { var clr = '#' + Common.Utils.ThemeColor.getHexColor(colors[j].get_r(), colors[j].get_g(), colors[j].get_b()); templateInsert = templateInsert + "" @@ -264,7 +264,7 @@ define([ onColorSchemaClick: function (event) { if (this.api) { var name = $(event.currentTarget).children('input').val(); - this.api.ChangeColorScheme(name); + this.api.asc_ChangeColorSchemeByIdx(name); } }, diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 0d2bf2bcd..68f5d6bef 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -1324,7 +1324,7 @@ define([ onColorSchemaClick: function(menu, item) { if (this.api) { - this.api.asc_ChangeColorScheme(item.value); + this.api.asc_ChangeColorSchemeByIdx(item.value); Common.component.Analytics.trackEvent('ToolBar', 'Color Scheme'); } @@ -1334,7 +1334,7 @@ define([ onColorSchemaShow: function(menu) { if (this.api) { - var value = this.api.asc_GetCurrentColorSchemeName(); + var value = this.api.asc_GetCurrentColorSchemeIndex(); var item = _.find(menu.items, function(item) { return item.value == value; }); (item) ? item.setChecked(true) : menu.clearAll(); } diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 7a06d91bd..d16174fd8 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -1984,7 +1984,7 @@ define([ cls : 'color-schemas-menu', colors : schemecolors, caption: (index < 21) ? (me.SchemeNames[index] || name) : name, - value: name, + value: index, checkable: true, toggleGroup: 'menuSchema' }); diff --git a/apps/spreadsheeteditor/mobile/app/controller/Settings.js b/apps/spreadsheeteditor/mobile/app/controller/Settings.js index b1113007a..823cc5da1 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Settings.js @@ -509,7 +509,7 @@ define([ _.each(schemas, function (schema, index) { var colors = schema.get_colors(),//schema.colors; name = schema.get_name(); - templateInsert = templateInsert + "