Change color scheme by index
This commit is contained in:
parent
ca417fa675
commit
f714a26da7
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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'
|
||||
});
|
||||
|
|
|
@ -357,7 +357,7 @@ define([
|
|||
_.each(schemas, function (schema, index) {
|
||||
var colors = schema.get_colors(), //schema.colors;
|
||||
name = schema.get_name();
|
||||
templateInsert = templateInsert + "<a class='color-schemes-menu item-link no-indicator'><input type='hidden' value='" + name + "'><div class='item-content'><div class='item-inner'><span class='color-schema-block'>";
|
||||
templateInsert = templateInsert + "<a class='color-schemes-menu item-link no-indicator'><input type='hidden' value='" + index + "'><div class='item-content'><div class='item-inner'><span class='color-schema-block'>";
|
||||
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 + "<span class='color' style='background: " + clr + ";'></span>"
|
||||
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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'
|
||||
});
|
||||
|
|
|
@ -252,7 +252,7 @@ define([
|
|||
_.each(schemas, function (schema, index) {
|
||||
var colors = schema.get_colors(),//schema.colors;
|
||||
name = schema.get_name();
|
||||
templateInsert = templateInsert + "<a class='color-schemes-menu item-link no-indicator'><input type='hidden' value='" + name + "'><div class='item-content'><div class='item-inner'><span class='color-schema-block'>";
|
||||
templateInsert = templateInsert + "<a class='color-schemes-menu item-link no-indicator'><input type='hidden' value='" + index + "'><div class='item-content'><div class='item-inner'><span class='color-schema-block'>";
|
||||
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 + "<span class='color' style='background: " + clr + ";'></span>"
|
||||
|
@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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'
|
||||
});
|
||||
|
|
|
@ -509,7 +509,7 @@ define([
|
|||
_.each(schemas, function (schema, index) {
|
||||
var colors = schema.get_colors(),//schema.colors;
|
||||
name = schema.get_name();
|
||||
templateInsert = templateInsert + "<a class='color-schemes-menu item-link no-indicator'><input type='hidden' value='" + name + "'><div class='item-content'><div class='item-inner'><span class='color-schema-block'>";
|
||||
templateInsert = templateInsert + "<a class='color-schemes-menu item-link no-indicator'><input type='hidden' value='" + index + "'><div class='item-content'><div class='item-inner'><span class='color-schema-block'>";
|
||||
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 + "<span class='color' style='background: " + clr + ";'></span>"
|
||||
|
@ -521,7 +521,7 @@ define([
|
|||
onColorSchemaClick: function(event) {
|
||||
if (this.api) {
|
||||
var name = $(event.currentTarget).children('input').val();
|
||||
this.api.asc_ChangeColorScheme(name);
|
||||
this.api.asc_ChangeColorSchemeByIdx(name);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue