Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Showing with 12 additions and 8 deletions.
  1. +12 −8 ample/runtime/modules/attributes.js
View
20 ample/runtime/modules/attributes.js
@@ -15,20 +15,24 @@ cQuery.prototype.attr = function(sQName, sValue) {
]);
//<-Guard
+ var aQName = sQName.split(':'),
+ sLocalName = aQName.pop(),
+ sPrefix = aQName.pop() || null,
+ sNameSpaceURI = null;
+ if (sPrefix != null)
+ sNameSpaceURI = this.resolver ? this.resolver(sPrefix) : oAmple.prefixes[sPrefix] || null;
+
if (arguments.length > 1) {
- var aQName = sQName.split(':'),
- sLocalName = aQName.pop(),
- sPrefix = aQName.pop() || null,
- sNameSpaceURI = null;
- if (sPrefix != null)
- sNameSpaceURI = this.resolver ? this.resolver(sPrefix) : oAmple.prefixes[sPrefix] || null;
fQuery_each(this, function() {
- sValue == null ? fElement_removeAttributeNS(this, sNameSpaceURI, sLocalName) : fElement_setAttributeNS(this, sNameSpaceURI, sQName, cString(sValue));
+ if (sValue == null)
+ sNameSpaceURI == null ? this.removeAttribute(sQName) : this.removeAttributeNS(sNameSpaceURI, sLocalName);
+ else
+ sNameSpaceURI == null ? this.setAttribute(sQName, sValue) : this.setAttributeNS(sNameSpaceURI, sQName, sValue);
});
return this;
}
else
if (this.length)
- return fElement_getAttribute(this[0], sQName);
+ return sNameSpaceURI == null ? this[0].getAttribute(sQName) : this[0].getAttributeNS(sNameSpaceURI, sLocalName);
return null;
};

No commit comments for this range

Something went wrong with that request. Please try again.