Use same modification in static create() method of ParagraphStyle and CharacterStyle as was used in PathStyle.

This commit is contained in:
Jürg Lehni 2011-05-17 13:14:04 +01:00
parent 2c03cb1ccb
commit c07f9b438e
3 changed files with 8 additions and 8 deletions

View file

@ -22,12 +22,11 @@ var CharacterStyle = this.CharacterStyle = PathStyle.extend({
});
this.base(style);
},
statics: {
create: function(item, other) {
create: function(item) {
var style = new CharacterStyle(CharacterStyle.dont);
style._item = item;
style.initialize(other);
return style;
}
}

View file

@ -22,10 +22,9 @@ var ParagraphStyle = this.ParagraphStyle = Base.extend({
},
statics: {
create: function(item, other) {
var style = new ParagraphStyle(PathStyle.dont);
create: function(item) {
var style = new CharacterStyle(CharacterStyle.dont);
style._item = item;
style.initialize(other);
return style;
}
}

View file

@ -20,7 +20,9 @@ var TextItem = this.TextItem = Item.extend({
initialize: function() {
this.base();
this.content = null;
this._characterStyle = CharacterStyle.create(this);
this.setCharacterStyle(this._project.getCurrentStyle());
this._paragraphStyle = ParagraphStyle.create(this);
this.setParagraphStyle();
},
@ -29,7 +31,7 @@ var TextItem = this.TextItem = Item.extend({
},
setCharacterStyle: function(style) {
this._characterStyle = CharacterStyle.create(this, style);
this._characterStyle.initialize(style);
},
getParagraphStyle: function() {
@ -37,6 +39,6 @@ var TextItem = this.TextItem = Item.extend({
},
setParagraphStyle: function(style) {
this._paragraphStyle = ParagraphStyle.create(this, style);
this._paragraphStyle.initialize(style);
}
});