[DE] Enable outline levels when custom styles are selected

This commit is contained in:
Julia Radzhabova 2018-03-16 18:27:07 +03:00
parent 53836e656f
commit edfdecff5e
2 changed files with 5 additions and 5 deletions

View file

@ -448,7 +448,7 @@ define([
if (isNaN(val))
val = this.oldValue;
} else {
val = me.options.defaultValue;
val = me.options.defaultValue - me.options.step;
}
me.setValue((this._add(val, me.options.step, (me.options.allowDecimal) ? 3 : 0) + ' ' + this.options.defaultUnit).trim(), suspend);
}

View file

@ -358,7 +358,8 @@ define([
var me = this,
docStyles = this.api.asc_GetStylesArray(),
styles = [];
styles = [],
checkStyles = false;
_.each(docStyles, function (style) {
var name = style.get_Name(),
level = me.api.asc_GetHeadingLevel(name);
@ -456,7 +457,7 @@ define([
}
this.spnLevels.setValue(new_end>0 ? new_end : '', true);
this.spnLevels.setDisabled(disable_outlines || new_start>1 );
checkStyles = (disable_outlines || new_start>1);
} else {
for (var i=this.startLevel; i<=this.endLevel; i++) {
var rec = _.findWhere(styles, {headerLevel: i});
@ -474,7 +475,7 @@ define([
return 0;
});
this.stylesLevels.reset(styles);
if (this.spnLevels.isDisabled()) {
if (checkStyles) {
this.radioStyles.setValue(true);
this.stylesList.scroller.update({alwaysVisibleY: true});
var rec = this.stylesLevels.findWhere({checked: true});
@ -557,7 +558,6 @@ define([
this.endLevel = new_end;
this.spnLevels.setValue(new_end>0 ? new_end : '', true);
this.spnLevels.setDisabled(disable_outlines || new_start>1 );
this._needUpdateOutlineLevels = false;
},