[SSE] Gradient Slider: remove color
This commit is contained in:
parent
124a457283
commit
87270ee486
|
@ -347,6 +347,13 @@ define([
|
||||||
pos = Math.max(0, Math.min(100, position)),
|
pos = Math.max(0, Math.min(100, position)),
|
||||||
value = pos/me.delta + me.minValue;
|
value = pos/me.delta + me.minValue;
|
||||||
|
|
||||||
|
if (me.isRemoveThumb) {
|
||||||
|
if (me.thumbs.length < 3) return;
|
||||||
|
me.trigger('removethumb', me, index);
|
||||||
|
me.trigger('change', me);
|
||||||
|
me.trigger('changecomplete', me);
|
||||||
|
}
|
||||||
|
|
||||||
me.setThumbPosition(index, pos);
|
me.setThumbPosition(index, pos);
|
||||||
me.thumbs[index].value = value;
|
me.thumbs[index].value = value;
|
||||||
|
|
||||||
|
@ -376,6 +383,10 @@ define([
|
||||||
pos = Math.max(0, Math.min(100, position)),
|
pos = Math.max(0, Math.min(100, position)),
|
||||||
value = pos/me.delta + me.minValue;
|
value = pos/me.delta + me.minValue;
|
||||||
|
|
||||||
|
var positionY = e.pageY*Common.Utils.zoom() - me.cmpEl.offset().top;
|
||||||
|
me.isRemoveThumb = positionY > me.cmpEl.height();
|
||||||
|
me.setRemoveThumb(index, me.isRemoveThumb);
|
||||||
|
|
||||||
me.setThumbPosition(index, pos);
|
me.setThumbPosition(index, pos);
|
||||||
me.thumbs[index].value = value;
|
me.thumbs[index].value = value;
|
||||||
|
|
||||||
|
@ -498,6 +509,14 @@ define([
|
||||||
if (suspend!==true) this.trigger('thumbclick', this, index);
|
if (suspend!==true) this.trigger('thumbclick', this, index);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setRemoveThumb: function(index, remove) {
|
||||||
|
if (remove) {
|
||||||
|
this.thumbs[index].thumb.addClass('remove');
|
||||||
|
} else {
|
||||||
|
this.thumbs[index].thumb.removeClass('remove');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
setThumbPosition: function(index, x) {
|
setThumbPosition: function(index, x) {
|
||||||
this.thumbs[index].position = x;
|
this.thumbs[index].position = x;
|
||||||
this.thumbs[index].thumb.css({left: x + '%'});
|
this.thumbs[index].thumb.css({left: x + '%'});
|
||||||
|
|
|
@ -40,6 +40,10 @@
|
||||||
&.active .thumb-bottom {
|
&.active .thumb-bottom {
|
||||||
border-bottom-width: 2px;
|
border-bottom-width: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.remove {
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.track {
|
.track {
|
||||||
|
|
|
@ -546,17 +546,16 @@ define([
|
||||||
});
|
});
|
||||||
fill.asc_getFill().asc_putPositions(arr);
|
fill.asc_getFill().asc_putPositions(arr);
|
||||||
|
|
||||||
if (this.OriginalFillType !== Asc.c_oAscFill.FILL_TYPE_GRAD) {
|
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
|
||||||
if (this.GradFillType == Asc.c_oAscFillGradType.GRAD_LINEAR) {
|
fill.asc_getFill().asc_putLinearAngle(this.GradLinearDirectionType * 60000);
|
||||||
fill.asc_getFill().asc_putLinearAngle(this.GradLinearDirectionType * 60000);
|
fill.asc_getFill().asc_putLinearScale(true);
|
||||||
fill.asc_getFill().asc_putLinearScale(true);
|
|
||||||
}
|
|
||||||
arr = [];
|
|
||||||
this.GradColor.colors.forEach(function(item){
|
|
||||||
arr.push(Common.Utils.ThemeColor.getRgbColor(item));
|
|
||||||
});
|
|
||||||
fill.asc_getFill().asc_putColors(arr);
|
|
||||||
}
|
}
|
||||||
|
arr = [];
|
||||||
|
this.GradColor.colors.forEach(function(item){
|
||||||
|
arr.push(Common.Utils.ThemeColor.getRgbColor(item));
|
||||||
|
});
|
||||||
|
fill.asc_getFill().asc_putColors(arr);
|
||||||
|
|
||||||
props.asc_putFill(fill);
|
props.asc_putFill(fill);
|
||||||
this.imgprops.asc_putShapeProperties(props);
|
this.imgprops.asc_putShapeProperties(props);
|
||||||
this.api.asc_setGraphicObjectProps(this.imgprops);
|
this.api.asc_setGraphicObjectProps(this.imgprops);
|
||||||
|
@ -1300,6 +1299,12 @@ define([
|
||||||
me.GradColor.colors[index] = me.GradColor.colors[nearIndex];
|
me.GradColor.colors[index] = me.GradColor.colors[nearIndex];
|
||||||
me.sldrGradient.addNewThumb(index, color);
|
me.sldrGradient.addNewThumb(index, color);
|
||||||
});
|
});
|
||||||
|
this.sldrGradient.on('removethumb', function(cmp, index){
|
||||||
|
me.GradColor.colors.splice(index, 1);
|
||||||
|
me.GradColor.values.splice(index, 1);
|
||||||
|
me.sldrGradient.removeThumb(index);
|
||||||
|
me.sldrGradient.changeGradientStyle();
|
||||||
|
});
|
||||||
this.fillControls.push(this.sldrGradient);
|
this.fillControls.push(this.sldrGradient);
|
||||||
|
|
||||||
this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({
|
this.cmbBorderSize = new Common.UI.ComboBorderSizeEditable({
|
||||||
|
|
Loading…
Reference in a new issue