Bug 52187

This commit is contained in:
OVSharova 2021-10-06 01:00:48 +03:00
parent 68ad058a65
commit 5ca8b6cff0
5 changed files with 69 additions and 60 deletions

View file

@ -986,27 +986,7 @@ define([
me.sldrGradient.setValue(index, me.GradColor.values[index]);
arrGrCollors.push(me.sldrGradient.getColorValue(index)+ ' '+ me.sldrGradient.getValue(index)*scale +'%');
}
me.gradientColorsStr= arrGrCollors.join(', ');
if (me.gradientColorsStr != "") {
if(me.mnuDirectionPicker.dataViewItems.length==1) {
me.mnuDirectionPicker.dataViewItems[0].$el.children(0).css({'background': 'radial-gradient(' + me.gradientColorsStr + ')'});
}
else
me.mnuDirectionPicker.dataViewItems.forEach(function (item){
var type = item.model.get('type')+90;
item.$el.children(0).css({'background': 'linear-gradient('+ type + 'deg, '+ me.gradientColorsStr + ')'});
});
if(this.typeGradient == -1)
this.btnDirection.$icon.css({'background': 'none'});
else if(this.typeGradient==2)
this.btnDirection.$icon.css({'background': ('radial-gradient(' + me.gradientColorsStr + ')')});
else
this.btnDirection.$icon.css({
'background': ('linear-gradient(' + this.typeGradient + 'deg, ' + me.gradientColorsStr + ')')
});
}
this.btnDirectionRedraw(me.sldrGradient, arrGrCollors.join(', '));
if (_.isUndefined(me.GradColor.currentIdx) || me.GradColor.currentIdx >= this.GradColor.colors.length) {
me.GradColor.currentIdx = 0;
@ -1220,6 +1200,28 @@ define([
}
},
btnDirectionRedraw: function(slider, gradientColorsStr) {
if(!slider.mouseFree) return;
this.gradientColorsStr = gradientColorsStr;
if (this.mnuDirectionPicker.dataViewItems.length == 1)
this.mnuDirectionPicker.dataViewItems[0].$el.children(0).css({'background': 'radial-gradient(' + gradientColorsStr + ')'});
else
this.mnuDirectionPicker.dataViewItems.forEach(function (item) {
var type = item.model.get('type') + 90;
item.$el.children(0).css({'background': 'linear-gradient(' + type + 'deg, ' + gradientColorsStr + ')'});
});
if (this.typeGradient == -1)
this.btnDirection.$icon.css({'background': 'none'});
else if (this.typeGradient == 2)
this.btnDirection.$icon.css({'background': ('radial-gradient(' + gradientColorsStr + ')')});
else
this.btnDirection.$icon.css({
'background': ('linear-gradient(' + this.typeGradient + 'deg, ' + gradientColorsStr + ')')
});
},
createDelayedControls: function() {
var me = this;

View file

@ -929,7 +929,6 @@ define([
me.sldrGradient.setValue(index, me.GradColor.values[index]);
arrGrCollors.push(me.sldrGradient.getColorValue(index)+ ' '+ me.sldrGradient.getValue(index)*scale +'%');
}
this.btnDirectionRedraw(me.sldrGradient, arrGrCollors.join(', '));
if (_.isUndefined(me.GradColor.currentIdx) || me.GradColor.currentIdx >= this.GradColor.colors.length) {

View file

@ -600,7 +600,6 @@ define([
for (var index=0; index < slider.thumbs.length; index++) {
arrGrCollors.push(slider.getColorValue(index)+ ' '+ slider.getValue(index)*scale +'%');
}
this.btnDirectionRedraw(slider, arrGrCollors.join(', '));
this._sendUndoPoint = true;

View file

@ -943,24 +943,7 @@ define([
me.sldrGradient.setValue(index, me.GradColor.values[index]);
arrGrCollors.push(me.sldrGradient.getColorValue(index)+ ' '+ me.sldrGradient.getValue(index) +'%');
}
me.gradientColorsStr= arrGrCollors.join(', ');
if (me.gradientColorsStr != "") {
if(me.mnuDirectionPicker.dataViewItems.length==1)
me.mnuDirectionPicker.dataViewItems[0].$el.children(0).css({'background': 'radial-gradient(' + me.gradientColorsStr + ')'});
else
me.mnuDirectionPicker.dataViewItems.forEach(function (item){
var type = item.model.get('type')+90;
item.$el.children(0).css({'background': 'linear-gradient('+ type + 'deg, '+ me.gradientColorsStr + ')'});
});
if(this.typeGradient == -1)
this.btnDirection.$icon.css({'background': 'none'});
else
this.btnDirection.$icon.css({
'background': ('linear-gradient(' + this.typeGradient + 'deg, ' + me.gradientColorsStr + ')')
});
}
this.btnDirectionRedraw(me.sldrGradient, arrGrCollors.join(', '));
if (_.isUndefined(me.GradColor.currentIdx) || me.GradColor.currentIdx >= me.GradColor.colors.length) {
me.GradColor.currentIdx = 0;
@ -1093,6 +1076,28 @@ define([
}
},
btnDirectionRedraw: function(slider, gradientColorsStr) {
if(!slider.mouseFree) return;
this.gradientColorsStr = gradientColorsStr;
if (this.mnuDirectionPicker.dataViewItems.length == 1)
this.mnuDirectionPicker.dataViewItems[0].$el.children(0).css({'background': 'radial-gradient(' + gradientColorsStr + ')'});
else
this.mnuDirectionPicker.dataViewItems.forEach(function (item) {
var type = item.model.get('type') + 90;
item.$el.children(0).css({'background': 'linear-gradient(' + type + 'deg, ' + gradientColorsStr + ')'});
});
if (this.typeGradient == -1)
this.btnDirection.$icon.css({'background': 'none'});
else if (this.typeGradient == 2)
this.btnDirection.$icon.css({'background': ('radial-gradient(' + gradientColorsStr + ')')});
else
this.btnDirection.$icon.css({
'background': ('linear-gradient(' + this.typeGradient + 'deg, ' + gradientColorsStr + ')')
});
},
UpdateThemeColors: function() {
if (!this.borderColor) {
// create color buttons

View file

@ -922,26 +922,8 @@ define([
me.sldrGradient.setValue(index, me.GradColor.values[index]);
arrGrCollors.push(me.sldrGradient.getColorValue(index)+ ' '+ me.sldrGradient.getValue(index)*scale +'%');
}
this.btnDirectionRedraw(me.sldrGradient, arrGrCollors.join(', '));
me.gradientColorsStr= arrGrCollors.join(', ');
if (me.gradientColorsStr != "") {
if(me.mnuDirectionPicker.dataViewItems.length==1)
me.mnuDirectionPicker.dataViewItems[0].$el.children(0).css({'background': 'radial-gradient(' + me.gradientColorsStr + ')'});
else
me.mnuDirectionPicker.dataViewItems.forEach(function (item){
var type = item.model.get('type')+90;
item.$el.children(0).css({'background': 'linear-gradient('+ type + 'deg, '+ me.gradientColorsStr + ')'});
});
if(this.typeGradient == -1)
this.btnDirection.$icon.css({'background': 'none'});
else if(this.typeGradient==2)
this.btnDirection.$icon.css({'background': ('radial-gradient(' + me.gradientColorsStr + ')')});
else
this.btnDirection.$icon.css({
'background': ('linear-gradient(' + this.typeGradient + 'deg, ' + me.gradientColorsStr + ')')
});
}
if (_.isUndefined(me.GradColor.currentIdx) || me.GradColor.currentIdx >= this.GradColor.colors.length) {
me.GradColor.currentIdx = 0;
}
@ -1156,6 +1138,28 @@ define([
}
},
btnDirectionRedraw: function(slider, gradientColorsStr) {
if(!slider.mouseFree) return;
this.gradientColorsStr = gradientColorsStr;
if (this.mnuDirectionPicker.dataViewItems.length == 1)
this.mnuDirectionPicker.dataViewItems[0].$el.children(0).css({'background': 'radial-gradient(' + gradientColorsStr + ')'});
else
this.mnuDirectionPicker.dataViewItems.forEach(function (item) {
var type = item.model.get('type') + 90;
item.$el.children(0).css({'background': 'linear-gradient(' + type + 'deg, ' + gradientColorsStr + ')'});
});
if (this.typeGradient == -1)
this.btnDirection.$icon.css({'background': 'none'});
else if (this.typeGradient == 2)
this.btnDirection.$icon.css({'background': ('radial-gradient(' + gradientColorsStr + ')')});
else
this.btnDirection.$icon.css({
'background': ('linear-gradient(' + this.typeGradient + 'deg, ' + gradientColorsStr + ')')
});
},
createDelayedControls: function() {
var me = this;