dom: function() {
return this.$element;
},
+ data: function() {
+ var dom = this.dom(),
+ args = Array.prototype.slice.call(arguments, 0);
+ if(args.length === 2 && args[1] === undefined)
+ return dom.removeData(args[0]);
+ return dom.data.apply(dom, arguments);
+ },
parent: function() {
var parents = this.$element.parents('[document-node-element]');
if(parents.length)
var element = this.fromHTMLElement(dom[0], canvas);
+ element.data('wlxmlNode', wlxmlNode);
+ wlxmlNode.setData('canvasElement', element);
+
element.setWlxml({tag: wlxmlNode.getTagName(), klass: wlxmlNode.getClass()});
_.keys(wlxmlNode.getMetaAttributes()).forEach(function(key) {
element2: parent.children()[myIdx + childrenLength-1 + (moveRightRange ? 1 : 0)]
};
},
- data: function() {
- var dom = this.dom(),
- args = Array.prototype.slice.call(arguments, 0);
- if(args.length === 2 && args[1] === undefined)
- return dom.removeData(args[0]);
- return dom.data.apply(dom, arguments);
- },
toXML: function(level) {
var node = $('<' + this.getWlxmlTag() + '>');
$.extend(DocumentTextElement, {
createDOM: function(wlxmlTextNode) {
- return $('<div>')
+ var dom = $('<div>')
.attr('document-text-element', '')
- .text(wlxmlTextNode.getText() || utils.unicode.ZWS);
+ .text(wlxmlTextNode.getText() || utils.unicode.ZWS),
+ element = this.fromHTMLElement(dom[0], this);
+ element.data('wlxmlNode', wlxmlTextNode);
+ return dom;
},
create: function(wlxmlTextNode, canvas) {