From: Aleksander Ɓukasz Date: Thu, 10 Oct 2013 13:45:05 +0000 (+0200) Subject: canvas: data method extracted to DocumentElement for exposure in DocumentTextElement X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/2149cd4d573417b17845741277bb66b795a85ca5 canvas: data method extracted to DocumentElement for exposure in DocumentTextElement --- diff --git a/src/editor/modules/documentCanvas/canvas/documentElement.js b/src/editor/modules/documentCanvas/canvas/documentElement.js index 4378e73..374d5c7 100644 --- a/src/editor/modules/documentCanvas/canvas/documentElement.js +++ b/src/editor/modules/documentCanvas/canvas/documentElement.js @@ -52,6 +52,13 @@ $.extend(DocumentElement.prototype, { 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) @@ -257,13 +264,6 @@ $.extend(DocumentNodeElement.prototype, { 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() + '>');