return toret;\r
}\r
\r
+Canvas.prototype.getPreviousNode = function(options) {\r
+ var element = $(this.content.find('#' + options.node.id).get(0));\r
+ var prev = element.prev()\r
+ if(prev.length === 0)\r
+ prev = element.parent();\r
+ return new wlxmlNode.Node(prev);\r
+}\r
+\r
Canvas.prototype._createNode = function(wlxmlTag, wlxmlClass) {\r
var toBlock = ['div', 'document', 'section', 'header'];\r
var htmlTag = _.contains(toBlock, wlxmlTag) ? 'div' : 'span';\r
\r
Canvas.prototype.insertNode = function(options) {\r
var element = $(this.content.find('#' + options.context.id).get(0));\r
- if(options.place == 'after')\r
- element[options.place](this._createNode(options.tag, options.klass));\r
+ if(options.place == 'after') {\r
+ var node = this._createNode(options.tag, options.klass);\r
+ element[options.place](node);\r
+ return node;\r
+ }\r
else if(options.place == 'wrapText') {\r
var elementContents = element.contents();\r
if(elementContents.length !== 1 || elementContents.get(0).nodeType != 3)\r