summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e35e6b0)
Changed behavior: wrapping current node happened upon clicking toolbar
icon while cursor exists but is not selecting. Now, for that to happen,
also ctrl key must be pressed. The former behavior now adds new node
after the current one.
}
} else if(canvas.getCurrentNodeElement()) {
wlxmlNode = canvas.getCurrentNodeElement().data('wlxmlNode');
}
} else if(canvas.getCurrentNodeElement()) {
wlxmlNode = canvas.getCurrentNodeElement().data('wlxmlNode');
- wrapper = insertNode(function() {
- return wlxmlNode.wrapWith({tagName: params.wlxmlTag, attrs: {'class': params.wlxmlClass}});
- });
+ if(params.ctrlKey) {
+ wrapper = insertNode(function() {
+ return wlxmlNode.wrapWith({tagName: params.wlxmlTag, attrs: {'class': params.wlxmlClass}});
+ });
+ } else {
+ wrapper = insertNode(function() {
+ var node = wlxmlNode.after({tagName: params.wlxmlTag, attrs: {'class': params.wlxmlClass}});
+ node.append({text:''});
+ return node;
+ });
+ }
canvas.setCurrentElement(utils.findCanvasElement(wrapper));
canvas.setCurrentElement(utils.findCanvasElement(wrapper));
+ _.extend(params, {ctrlKey: e.ctrlKey});
+
sandbox.publish('command', command, params);
}
});
sandbox.publish('command', command, params);
}
});