- insertNode(function() {
- return canvas.wlxmlDocument.wrapNodes({
- node1: siblingParents.node1,
- node2: siblingParents.node2,
- _with: {tagName: params.wlxmlTag, attrs: {'class': params.wlxmlClass}}
+ insertNode(
+ function() {
+ return canvas.wlxmlDocument.wrapNodes({
+ node1: siblingParents.node1,
+ node2: siblingParents.node2,
+ _with: {tagName: params.wlxmlTag, attrs: {'class': params.wlxmlClass}}
+ });
+ }
+ );
+ }
+ }
+ } else if(canvas.getCurrentNodeElement()) {
+ wlxmlNode = canvas.getCurrentNodeElement().wlxmlNode;
+
+ var linkFound = [wlxmlNode].concat(wlxmlNode.parents()).some(function(node) {
+ if(node.getClass() === 'link') {
+ var dialog = Dialog.create({
+ title: gettext('Edit link'),
+ executeButtonText: gettext('Apply'),
+ cancelButtonText: gettext('Cancel'),
+ fields: [
+ {label: gettext('Link'), name: 'href', type: 'input', initialValue: node.getAttr('href')},
+ ]
+ });
+ dialog.on('execute', function(event) {
+ canvas.wlxmlDocument.transaction(function() {
+ node.setAttr('href', event.formData.href);
+ event.success();