From 2149cd4d573417b17845741277bb66b795a85ca5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Thu, 10 Oct 2013 15:45:05 +0200 Subject: [PATCH 1/1] canvas: data method extracted to DocumentElement for exposure in DocumentTextElement --- .../documentCanvas/canvas/documentElement.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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() + '>'); -- 2.20.1