mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-23 21:46:07 +08:00
fixed color picking
This commit is contained in:
@ -191,10 +191,16 @@ define([
|
||||
Common.NotificationCenter.trigger('edit:complete', this);
|
||||
},
|
||||
|
||||
onSelectSparklineColorMenu: function (menu, item) {
|
||||
if (item.value === 1 && this.mnuSparklineColorPicker) {
|
||||
this.mnuSparklineColorPicker.addNewColor();
|
||||
};
|
||||
onSelectSparklineColorMenu: function (menu, item, picker, sparkColor) {
|
||||
if (!sparkColor) {
|
||||
if (item.value === 1 && picker) {
|
||||
picker.addNewColor();
|
||||
};
|
||||
} else {
|
||||
if (item.value === 1 && this.mnuSparklineColorPicker) {
|
||||
this.mnuSparklineColorPicker.addNewColor();
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
onSelectSparkType: function (type) {
|
||||
@ -308,7 +314,7 @@ define([
|
||||
var type1 = typeof(this.SparkColor),
|
||||
type2 = typeof(this._state.SparkColor);
|
||||
if ( (type1 !== type2) || (type1=='object' && (this.SparkColor.effectValue!==this._state.SparkColor.effectValue || this._state.SparkColor.color.indexOf(this.SparkColor.color)<0)) ||
|
||||
(type1!='object' && (this._state.SparkColor.indexOf(this.SparkColor)<0 || typeof(this.btnSparkColor.color)=='object'))) {
|
||||
(type1!='object' && (this._state.SparkColor.indexOf(this.SparkColor)<0))) {
|
||||
|
||||
Common.Utils.ThemeColor.selectPickerColorByEffect(this.SparkColor, this.mnuSparklineColorPicker);
|
||||
this._state.SparkColor = this.SparkColor;
|
||||
|
||||
@ -133,7 +133,7 @@ define([
|
||||
me.fireEvent('sparkline:type', [2]);
|
||||
});
|
||||
this.btnSparklineColor.menu.on('item:click', function (menu, item) {
|
||||
me.fireEvent('sparkline:addnewcolor', [menu, item])
|
||||
me.fireEvent('sparkline:addnewcolor', [menu, item, null, true])
|
||||
});
|
||||
this.btnClear.menu.on('item:click', function (menu, item, e) {
|
||||
me.fireEvent('sparkline:clear', [menu, item, e])
|
||||
@ -519,15 +519,15 @@ define([
|
||||
]
|
||||
});
|
||||
|
||||
subMenu.on('item:click', function (menu, color) {
|
||||
me.fireEvent('sparkline:addnewcolor', [menu, color])
|
||||
})
|
||||
item.setMenu(subMenu);
|
||||
|
||||
var colorsMenu = new Common.UI.ThemeColorPalette({
|
||||
el: $(`#sparkline-markers-menu-picker${index}`),
|
||||
outerMenu: {menu: item.menu, index: 0}
|
||||
});
|
||||
subMenu.on('item:click', function (menu, color) {
|
||||
me.fireEvent('sparkline:addnewcolor', [menu, color, colorsMenu])
|
||||
})
|
||||
item.menu.setInnerMenu([{menu: colorsMenu, index: 0}]);
|
||||
colorsMenu.updateColors(Common.Utils.ThemeColor.getEffectColors(), Common.Utils.ThemeColor.getStandartColors());
|
||||
colorsMenu.on('select', function (item, color) {
|
||||
|
||||
Reference in New Issue
Block a user