[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) {
|
selectByIndex: function(index) {
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
this.fieldPicker.deselectAll();
|
this.fieldPicker.deselectAll();
|
||||||
|
|
|
@ -729,7 +729,7 @@ define([
|
||||||
var styleRec = listStyle.menuPicker.store.findWhere({
|
var styleRec = listStyle.menuPicker.store.findWhere({
|
||||||
title: name
|
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.menuPicker.selectRecord(styleRec);
|
||||||
listStyle.resumeEvents();
|
listStyle.resumeEvents();
|
||||||
|
@ -1881,7 +1881,7 @@ define([
|
||||||
me._state.prstyle = title;
|
me._state.prstyle = title;
|
||||||
style.put_Name(title);
|
style.put_Name(title);
|
||||||
characterStyle.put_Name(title + '_character');
|
characterStyle.put_Name(title + '_character');
|
||||||
style.put_Next(nextStyle.asc_getName());
|
style.put_Next((nextStyle) ? nextStyle.asc_getName() : null);
|
||||||
me.api.asc_AddNewStyle(style);
|
me.api.asc_AddNewStyle(style);
|
||||||
}
|
}
|
||||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
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});
|
if (self._state.prstyle) styleRec = listStyles.menuPicker.store.findWhere({title: self._state.prstyle});
|
||||||
listStyles.fillComboView((styleRec) ? styleRec : listStyles.menuPicker.store.at(0), true);
|
listStyles.fillComboView((styleRec) ? styleRec : listStyles.menuPicker.store.at(0), true);
|
||||||
Common.NotificationCenter.trigger('edit:complete', this);
|
Common.NotificationCenter.trigger('edit:complete', this);
|
||||||
}
|
} else if (listStyles.rendered)
|
||||||
|
listStyles.clearComboView();
|
||||||
window.styles_loaded = true;
|
window.styles_loaded = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -107,9 +107,10 @@ define([
|
||||||
menuStyle : 'width: 100%; max-height: 290px;',
|
menuStyle : 'width: 100%; max-height: 290px;',
|
||||||
editable : false,
|
editable : false,
|
||||||
cls : 'input-group-nr',
|
cls : 'input-group-nr',
|
||||||
data : this.options.formats
|
data : this.options.formats,
|
||||||
|
disabled : (this.options.formats.length==0)
|
||||||
});
|
});
|
||||||
|
if (this.options.formats.length>0)
|
||||||
this.cmbNextStyle.setValue(this.options.formats[0].value);
|
this.cmbNextStyle.setValue(this.options.formats[0].value);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -129,7 +130,7 @@ define([
|
||||||
|
|
||||||
getNextStyle: function () {
|
getNextStyle: function () {
|
||||||
var me = this;
|
var me = this;
|
||||||
return me.cmbNextStyle.getValue();
|
return (me.options.formats.length>0) ? me.cmbNextStyle.getValue() : null;
|
||||||
},
|
},
|
||||||
|
|
||||||
onBtnClick: function(event) {
|
onBtnClick: function(event) {
|
||||||
|
|
Loading…
Reference in a new issue