Border color refactoring: select border color for shape without border and then reselect shape (or apply other settings).

This commit is contained in:
Julia Radzhabova 2017-10-31 15:36:28 +03:00
parent 4224c75d7d
commit 1a8e591351
6 changed files with 18 additions and 12 deletions

View file

@ -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'))) {

View file

@ -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'))) {

View file

@ -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'))) {

View file

@ -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'))) {

View file

@ -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'))) {

View file

@ -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'))) {