return documentElement.DocumentNodeElement.fromHTMLElement(this.d.get(0), this); //{wlxmlTag: this.d.prop('tagName')};
},
+ toggleElementHighlight: function(node, toggle) {
+ var element = utils.findCanvasElement(node);
+ element.toggleHighlight(toggle);
+ },
+
createNodeElement: function(params) {
return documentElement.DocumentNodeElement.create(params, this);
},
setCurrentElement: function(element, params) {
+ if(!(element instanceof documentElement.DocumentElement)) {
+ element = utils.findCanvasElement(element);
+ }
+
params = _.extend({caretTo: 'end'}, params);
var findFirstDirectTextChild = function(e, nodeToLand) {
var byBrowser = this.getCursor().getPosition().element;
}
sandbox.publish('currentNodeElementChanged', currentNodeElement);
},
- highlightElement: function(element) {
- element.toggleHighlight(true);
+ highlightElement: function(node) {
+ canvas.toggleElementHighlight(node, true);
},
- dimElement: function(element) {
- element.toggleHighlight(false);
+ dimElement: function(node) {
+ canvas.toggleElementHighlight(node, false);
},
- jumpToElement: function(element) {
- canvas.setCurrentElement(element);
+ jumpToElement: function(node) {
+ canvas.setCurrentElement(node);
},
command: function(command, params) {
commands.run(command, params, canvas);
var view = this;
this.dom.on('click', 'a', function(e) {
var target = $(e.target);
- sandbox.publish('elementClicked', target.data('element'));
+ sandbox.publish('nodeClicked', target.data('element'));
});
this.dom.on('mouseenter', 'a', function(e) {
var target = $(e.target);
- sandbox.publish('elementEntered', target.data('element'));
+ sandbox.publish('nodeEntered', target.data('element'));
});
this.dom.on('mouseleave', 'a', function(e) {
var target = $(e.target);
- sandbox.publish('elementLeft', target.data('element'));
+ sandbox.publish('nodeLeft', target.data('element'));
});
},
setElement: function(element) {
ready: function() {
views.currentNodePaneLayout.appendView(sandbox.getModule('nodeFamilyTree').getView());
},
- elementEntered: function(element) {
- commands.highlightDocumentElement(element, 'nodeFamilyTree');
+ nodeEntered: function(node) {
+ commands.highlightDocumentElement(node, 'nodeFamilyTree');
},
- elementLeft: function(element) {
- commands.dimDocumentElement(element, 'nodeFamilyTree');
+ nodeLeft: function(node) {
+ commands.dimDocumentElement(node, 'nodeFamilyTree');
},
- elementClicked: function(element) {
- commands.jumpToDocumentElement(element);
+ nodeClicked: function(node) {
+ commands.jumpToDocumentElement(node);
}
};