Border color refactoring: select border color for shape without border and then reselect shape (or apply other settings).
This commit is contained in:
parent
4224c75d7d
commit
1a8e591351
|
@ -979,7 +979,8 @@ define([
|
||||||
// border colors
|
// border colors
|
||||||
var stroke = shapeprops.get_stroke(),
|
var stroke = shapeprops.get_stroke(),
|
||||||
strokeType = stroke.get_type(),
|
strokeType = stroke.get_type(),
|
||||||
borderType;
|
borderType,
|
||||||
|
update = (this._state.StrokeColor == 'transparent' && this.BorderColor.Color !== 'transparent'); // border color was changed for shape without line and then shape was reselected (or apply other settings)
|
||||||
|
|
||||||
if (stroke) {
|
if (stroke) {
|
||||||
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
|
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
|
||||||
|
@ -1005,7 +1006,7 @@ define([
|
||||||
type1 = typeof(this.BorderColor.Color);
|
type1 = typeof(this.BorderColor.Color);
|
||||||
type2 = typeof(this._state.StrokeColor);
|
type2 = typeof(this._state.StrokeColor);
|
||||||
|
|
||||||
if ( (type1 !== type2) || (type1=='object' &&
|
if ( update || (type1 !== type2) || (type1=='object' &&
|
||||||
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
|
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
|
||||||
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {
|
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {
|
||||||
|
|
||||||
|
|
|
@ -672,7 +672,8 @@ define([
|
||||||
// border colors
|
// border colors
|
||||||
var stroke = shapeprops.asc_getLine(),
|
var stroke = shapeprops.asc_getLine(),
|
||||||
strokeType = (stroke) ? stroke.get_type() : null,
|
strokeType = (stroke) ? stroke.get_type() : null,
|
||||||
borderType;
|
borderType,
|
||||||
|
update = (this._state.StrokeColor == 'transparent' && this.BorderColor.Color !== 'transparent'); // border color was changed for shape without line and then shape was reselected (or apply other settings)
|
||||||
|
|
||||||
if (stroke) {
|
if (stroke) {
|
||||||
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
|
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
|
||||||
|
@ -697,7 +698,7 @@ define([
|
||||||
type1 = typeof(this.BorderColor.Color);
|
type1 = typeof(this.BorderColor.Color);
|
||||||
type2 = typeof(this._state.StrokeColor);
|
type2 = typeof(this._state.StrokeColor);
|
||||||
|
|
||||||
if ( (type1 !== type2) || (type1=='object' &&
|
if ( update || (type1 !== type2) || (type1=='object' &&
|
||||||
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
|
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
|
||||||
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {
|
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {
|
||||||
|
|
||||||
|
|
|
@ -892,7 +892,8 @@ define([
|
||||||
// border colors
|
// border colors
|
||||||
var stroke = props.get_stroke(),
|
var stroke = props.get_stroke(),
|
||||||
strokeType = stroke.get_type(),
|
strokeType = stroke.get_type(),
|
||||||
borderType;
|
borderType,
|
||||||
|
update = (this._state.StrokeColor == 'transparent' && this.BorderColor.Color !== 'transparent'); // border color was changed for shape without line and then shape was reselected (or apply other settings)
|
||||||
|
|
||||||
if (stroke) {
|
if (stroke) {
|
||||||
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
|
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
|
||||||
|
@ -918,7 +919,7 @@ define([
|
||||||
type1 = typeof(this.BorderColor.Color);
|
type1 = typeof(this.BorderColor.Color);
|
||||||
type2 = typeof(this._state.StrokeColor);
|
type2 = typeof(this._state.StrokeColor);
|
||||||
|
|
||||||
if ( (type1 !== type2) || (type1=='object' &&
|
if ( update || (type1 !== type2) || (type1=='object' &&
|
||||||
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
|
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
|
||||||
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {
|
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {
|
||||||
|
|
||||||
|
|
|
@ -871,7 +871,8 @@ define([
|
||||||
// border colors
|
// border colors
|
||||||
var stroke = shapeprops.asc_getLine(),
|
var stroke = shapeprops.asc_getLine(),
|
||||||
strokeType = (stroke) ? stroke.get_type() : null,
|
strokeType = (stroke) ? stroke.get_type() : null,
|
||||||
borderType;
|
borderType,
|
||||||
|
update = (this._state.StrokeColor == 'transparent' && this.BorderColor.Color !== 'transparent'); // border color was changed for shape without line and then shape was reselected (or apply other settings)
|
||||||
|
|
||||||
if (stroke) {
|
if (stroke) {
|
||||||
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
|
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
|
||||||
|
@ -896,7 +897,7 @@ define([
|
||||||
type1 = typeof(this.BorderColor.Color);
|
type1 = typeof(this.BorderColor.Color);
|
||||||
type2 = typeof(this._state.StrokeColor);
|
type2 = typeof(this._state.StrokeColor);
|
||||||
|
|
||||||
if ( (type1 !== type2) || (type1=='object' &&
|
if ( update || (type1 !== type2) || (type1=='object' &&
|
||||||
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
|
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
|
||||||
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {
|
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {
|
||||||
|
|
||||||
|
|
|
@ -916,7 +916,8 @@ define([
|
||||||
// border colors
|
// border colors
|
||||||
var stroke = shapeprops.asc_getStroke(),
|
var stroke = shapeprops.asc_getStroke(),
|
||||||
strokeType = stroke.asc_getType(),
|
strokeType = stroke.asc_getType(),
|
||||||
borderType;
|
borderType,
|
||||||
|
update = (this._state.StrokeColor == 'transparent' && this.BorderColor.Color !== 'transparent'); // border color was changed for shape without line and then shape was reselected (or apply other settings)
|
||||||
|
|
||||||
if (stroke) {
|
if (stroke) {
|
||||||
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
|
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
|
||||||
|
@ -942,7 +943,7 @@ define([
|
||||||
type1 = typeof(this.BorderColor.Color);
|
type1 = typeof(this.BorderColor.Color);
|
||||||
type2 = typeof(this._state.StrokeColor);
|
type2 = typeof(this._state.StrokeColor);
|
||||||
|
|
||||||
if ( (type1 !== type2) || (type1=='object' &&
|
if ( update || (type1 !== type2) || (type1=='object' &&
|
||||||
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
|
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
|
||||||
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {
|
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {
|
||||||
|
|
||||||
|
|
|
@ -875,7 +875,8 @@ define([
|
||||||
// border colors
|
// border colors
|
||||||
var stroke = shapeprops.asc_getLine(),
|
var stroke = shapeprops.asc_getLine(),
|
||||||
strokeType = (stroke) ? stroke.asc_getType() : null,
|
strokeType = (stroke) ? stroke.asc_getType() : null,
|
||||||
borderType;
|
borderType,
|
||||||
|
update = (this._state.StrokeColor == 'transparent' && this.BorderColor.Color !== 'transparent'); // border color was changed for shape without line and then shape was reselected (or apply other settings)
|
||||||
|
|
||||||
if (stroke) {
|
if (stroke) {
|
||||||
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
|
if ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) {
|
||||||
|
@ -900,7 +901,7 @@ define([
|
||||||
type1 = typeof(this.BorderColor.Color);
|
type1 = typeof(this.BorderColor.Color);
|
||||||
type2 = typeof(this._state.StrokeColor);
|
type2 = typeof(this._state.StrokeColor);
|
||||||
|
|
||||||
if ( (type1 !== type2) || (type1=='object' &&
|
if ( update || (type1 !== type2) || (type1=='object' &&
|
||||||
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
|
(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue || this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)) ||
|
||||||
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {
|
(type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue