X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/8652ad3f4a86e5019404ac90be9c7325ad077920..20b9b567165ee10532a441f809a2a718b5b5e570:/src/smartxml/smartxml.js?ds=sidebyside diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index aa9a7c5..6cc3e33 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -395,6 +395,17 @@ ElementNode.prototype.transformations.register(transformations.createContextTran } })); +ElementNode.prototype.transformations.register(transformations.createContextTransformation({ + name: 'smartxml.setAttr2', + impl: function(args) { + this.prevAttr = this.getAttr(args.name); + this.setAttr(args.name, args.value); + }, + undo: function(args) { + this.setAttr(args.name, this.prevAttr); + } +})); + DocumentNode.prototype.transformations.register(transformations.createContextTransformation({ name: 'smartxml.wrapWith', getChangeRoot: function() { @@ -542,6 +553,10 @@ TextNode.prototype.transformations.register(transformations.createContextTransfo }, getChangeRoot: function() { return this.context.parent().parent(); + }, + isAllowed: function(args) { + var parent = this.parent(); + return !!(parent && parent.parent()); } }));