[DE] Bugs with document without styles: update from style, create new style, delete all styles.
This commit is contained in:
parent
7ea197b4eb
commit
24dec9d752
|
@ -456,6 +456,10 @@ define([
|
|||
}
|
||||
},
|
||||
|
||||
clearComboView: function() {
|
||||
this.fieldPicker.store.reset([]);
|
||||
},
|
||||
|
||||
selectByIndex: function(index) {
|
||||
if (index < 0)
|
||||
this.fieldPicker.deselectAll();
|
||||
|
|
|
@ -729,7 +729,7 @@ define([
|
|||
var styleRec = listStyle.menuPicker.store.findWhere({
|
||||
title: name
|
||||
});
|
||||
this._state.prstyle = (listStyle.menuPicker.store.length>0) ? name : undefined;
|
||||
this._state.prstyle = (listStyle.menuPicker.store.length>0 || window.styles_loaded) ? name : undefined;
|
||||
|
||||
listStyle.menuPicker.selectRecord(styleRec);
|
||||
listStyle.resumeEvents();
|
||||
|
@ -1881,7 +1881,7 @@ define([
|
|||
me._state.prstyle = title;
|
||||
style.put_Name(title);
|
||||
characterStyle.put_Name(title + '_character');
|
||||
style.put_Next(nextStyle.asc_getName());
|
||||
style.put_Next((nextStyle) ? nextStyle.asc_getName() : null);
|
||||
me.api.asc_AddNewStyle(style);
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||
|
@ -2619,7 +2619,8 @@ define([
|
|||
if (self._state.prstyle) styleRec = listStyles.menuPicker.store.findWhere({title: self._state.prstyle});
|
||||
listStyles.fillComboView((styleRec) ? styleRec : listStyles.menuPicker.store.at(0), true);
|
||||
Common.NotificationCenter.trigger('edit:complete', this);
|
||||
}
|
||||
} else if (listStyles.rendered)
|
||||
listStyles.clearComboView();
|
||||
window.styles_loaded = true;
|
||||
},
|
||||
|
||||
|
|
|
@ -107,10 +107,11 @@ define([
|
|||
menuStyle : 'width: 100%; max-height: 290px;',
|
||||
editable : false,
|
||||
cls : 'input-group-nr',
|
||||
data : this.options.formats
|
||||
data : this.options.formats,
|
||||
disabled : (this.options.formats.length==0)
|
||||
});
|
||||
|
||||
this.cmbNextStyle.setValue(this.options.formats[0].value);
|
||||
if (this.options.formats.length>0)
|
||||
this.cmbNextStyle.setValue(this.options.formats[0].value);
|
||||
},
|
||||
|
||||
show: function() {
|
||||
|
@ -129,7 +130,7 @@ define([
|
|||
|
||||
getNextStyle: function () {
|
||||
var me = this;
|
||||
return me.cmbNextStyle.getValue();
|
||||
return (me.options.formats.length>0) ? me.cmbNextStyle.getValue() : null;
|
||||
},
|
||||
|
||||
onBtnClick: function(event) {
|
||||
|
|
Loading…
Reference in a new issue