this.canvas = null;
return this;
},
- handle: function(event) {
- var toSet = event.meta.node.getText();
- if(toSet === '') {
- toSet = utils.unicode.ZWS;
+ setText: function(text) {
+ if(text === '') {
+ text = utils.unicode.ZWS;
}
- if(toSet !== this.getText()) {
- this.setText(toSet);
+ if(text !== this.getText()) {
+ this.dom.contents()[0].data = text;
}
},
- setText: function(text) {
- this.dom.contents()[0].data = text;
- },
getText: function(options) {
options = _.extend({raw: false}, options || {});
var toret = this.dom.text();
},
nodeTextChange: function(event) {
var element = utils.getElementForNode(event.meta.node);
- element.handle(event);
+ element.setText(event.meta.node.getText());
},
metadataChanged: _metadataEventHandler,