+ Added attr to iQ, plus a unit test for it

+ Fixed click handler for expand button (it was allowing drag, and also it was on mousedown)
+ Added Ehsan and Raymond to the install.rdf contributors list
This commit is contained in:
Ian Gilman 2010-06-21 17:27:12 -07:00
parent 697bec4faa
commit 27094a5d62

View File

@ -524,6 +524,27 @@ iQ.fn = iQ.prototype = {
return this;
},
// ----------
// Function: attr
// Sets or gets an attribute on the element(s).
attr: function(key, value) {
try {
Utils.assert('string key', typeof key === 'string');
if(value === undefined) {
Utils.assert('retrieval does not support multi-objects (or null objects)', this.length == 1);
return this[0].getAttribute(key);
} else {
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
elem.setAttribute(key, value);
}
}
} catch(e) {
Utils.log(e);
}
return this;
},
// ----------
// Function: css
css: function(a, b) {