this.node.on('click', '[wlxml-tag]', function(e) {\r
e.stopPropagation();\r
console.log('clicked node type: '+e.target.nodeType);\r
- view._markSelected($(e.target));\r
+ view._markSelected(new wlxmlNode.Node($(e.target)));\r
});\r
\r
this.node.on('keyup', '#rng-module-documentCanvas-contentWrapper', function(e) {\r
anchor = anchor.parent();\r
if(!anchor.is('[wlxml-tag]'))\r
return;\r
- view._markSelected(anchor);\r
+ view._markSelected(new wlxmlNode.Node(anchor));\r
});\r
\r
this.node.on('keydown', '#rng-module-documentCanvas-contentWrapper', function(e) {\r
_markSelected: function(node) {\r
this.dimNode(node);\r
\r
+ \r
this.node.find('.rng-module-documentCanvas-currentNode').removeClass('rng-module-documentCanvas-currentNode');\r
\r
- node.addClass('rng-module-documentCanvas-currentNode');\r
+ this.getNodeElement(node).addClass('rng-module-documentCanvas-currentNode');\r
\r
this.currentNode = node;\r
- sandbox.publish('nodeSelected', new wlxmlNode.Node(node));\r
+ sandbox.publish('nodeSelected', node);\r
\r
},\r
selectNode: function(node) {\r
- node = this.getNodeElement(node);\r
view._markSelected(node);\r
var range = document.createRange();\r
- range.selectNodeContents(node[0]);\r
+ range.selectNodeContents(this.getNodeElement(node)[0]);\r
range.collapse(false);\r
\r
var selection = document.getSelection();\r