[Pkg-javascript-commits] [ltx] 352/469: adding removeAttributeNS methods

Jonas Smedegaard dr at jones.dk
Wed Aug 31 13:03:25 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository ltx.

commit 3f7802a8c55f3363f3a0592eae2a7a5b0ac770ab
Author: julien <julien.genestoux at gmail.com>
Date:   Mon Oct 20 21:45:33 2014 +0200

    adding removeAttributeNS methods
---
 lib/dom-element.js | 13 +++++++++++++
 ltx-browser.js     | 13 +++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/lib/dom-element.js b/lib/dom-element.js
index 2117d2c..55311c2 100644
--- a/lib/dom-element.js
+++ b/lib/dom-element.js
@@ -86,6 +86,19 @@ DOMElement.prototype.removeAttribute = function (name) {
     this.attr(name, null)
 }
 
+DOMElement.prototype.removeAttributeNS = function (ns, name) {
+    var prefix
+    if (ns === 'http://www.w3.org/XML/1998/namespace') {
+        prefix = 'xml'
+    } else {
+        var nss = this.getXmlns()
+        prefix = nss[ns] || ''
+    }
+    if (prefix) {
+        this.attr([prefix, name].join(':'), null)
+    }
+}
+
 DOMElement.prototype.appendChild = function (el) {
     this.cnode(el)
 }
diff --git a/ltx-browser.js b/ltx-browser.js
index ecd2fa2..f6e7d69 100644
--- a/ltx-browser.js
+++ b/ltx-browser.js
@@ -87,6 +87,19 @@ DOMElement.prototype.removeAttribute = function (name) {
     this.attr(name, null)
 }
 
+DOMElement.prototype.removeAttributeNS = function (ns, name) {
+    var prefix
+    if (ns === 'http://www.w3.org/XML/1998/namespace') {
+        prefix = 'xml'
+    } else {
+        var nss = this.getXmlns()
+        prefix = nss[ns] || ''
+    }
+    if (prefix) {
+        this.attr([prefix, name].join(':'), null)
+    }
+}
+
 DOMElement.prototype.appendChild = function (el) {
     this.cnode(el)
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/ltx.git



More information about the Pkg-javascript-commits mailing list