From 1a8e591351c7475b5089944513ae7d896a00594d Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 31 Oct 2017 15:36:28 +0300 Subject: [PATCH] Border color refactoring: select border color for shape without border and then reselect shape (or apply other settings). --- apps/documenteditor/main/app/view/ShapeSettings.js | 5 +++-- apps/documenteditor/main/app/view/TextArtSettings.js | 5 +++-- apps/presentationeditor/main/app/view/ShapeSettings.js | 5 +++-- apps/presentationeditor/main/app/view/TextArtSettings.js | 5 +++-- apps/spreadsheeteditor/main/app/view/ShapeSettings.js | 5 +++-- apps/spreadsheeteditor/main/app/view/TextArtSettings.js | 5 +++-- 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js index 72f4a4919..7828424e5 100644 --- a/apps/documenteditor/main/app/view/ShapeSettings.js +++ b/apps/documenteditor/main/app/view/ShapeSettings.js @@ -979,7 +979,8 @@ define([ // border colors var stroke = shapeprops.get_stroke(), 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 ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) { @@ -1005,7 +1006,7 @@ define([ type1 = typeof(this.BorderColor.Color); 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)) || (type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) { diff --git a/apps/documenteditor/main/app/view/TextArtSettings.js b/apps/documenteditor/main/app/view/TextArtSettings.js index 35ec21de0..859f8c90b 100644 --- a/apps/documenteditor/main/app/view/TextArtSettings.js +++ b/apps/documenteditor/main/app/view/TextArtSettings.js @@ -672,7 +672,8 @@ define([ // border colors var stroke = shapeprops.asc_getLine(), 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 ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) { @@ -697,7 +698,7 @@ define([ type1 = typeof(this.BorderColor.Color); 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)) || (type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) { diff --git a/apps/presentationeditor/main/app/view/ShapeSettings.js b/apps/presentationeditor/main/app/view/ShapeSettings.js index aa989206f..3d96ff791 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettings.js +++ b/apps/presentationeditor/main/app/view/ShapeSettings.js @@ -892,7 +892,8 @@ define([ // border colors var stroke = props.get_stroke(), 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 ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) { @@ -918,7 +919,7 @@ define([ type1 = typeof(this.BorderColor.Color); 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)) || (type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) { diff --git a/apps/presentationeditor/main/app/view/TextArtSettings.js b/apps/presentationeditor/main/app/view/TextArtSettings.js index d39780326..a568842db 100644 --- a/apps/presentationeditor/main/app/view/TextArtSettings.js +++ b/apps/presentationeditor/main/app/view/TextArtSettings.js @@ -871,7 +871,8 @@ define([ // border colors var stroke = shapeprops.asc_getLine(), 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 ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) { @@ -896,7 +897,7 @@ define([ type1 = typeof(this.BorderColor.Color); 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)) || (type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) { diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js index 10a296181..ed33ce59f 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js @@ -916,7 +916,8 @@ define([ // border colors var stroke = shapeprops.asc_getStroke(), 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 ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) { @@ -942,7 +943,7 @@ define([ type1 = typeof(this.BorderColor.Color); 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)) || (type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) { diff --git a/apps/spreadsheeteditor/main/app/view/TextArtSettings.js b/apps/spreadsheeteditor/main/app/view/TextArtSettings.js index 8ee40be0e..b54521a30 100644 --- a/apps/spreadsheeteditor/main/app/view/TextArtSettings.js +++ b/apps/spreadsheeteditor/main/app/view/TextArtSettings.js @@ -875,7 +875,8 @@ define([ // border colors var stroke = shapeprops.asc_getLine(), 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 ( strokeType == Asc.c_oAscStrokeType.STROKE_COLOR ) { @@ -900,7 +901,7 @@ define([ type1 = typeof(this.BorderColor.Color); 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)) || (type1!='object' && (this._state.StrokeColor.indexOf(this.BorderColor.Color)<0 || typeof(this.btnBorderColor.color)=='object'))) {