forked from thatcher/env-js
-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
I get the feeling this project is long since abandoned, but I'll leave this here for what it's worth. It was a great project, BTW!
Env.js 1.2 doesn't support a.hash. That is, if you create an anchor tag, with an href, and then try to look it up via a.hash, it returns undefined. This code fixes that (albeit crudely):
HTMLElement.prototype.setAttribute = function(name, value) {
//console.log("CSS set attribute: " + name + ", " + value);
origSetAttribute.apply(this, arguments);
if (name === "style") {
updateCss2Props(this, value);
}
// Add support for 'HTMLAnchorTag.hash'
if (this.tagName === "A" && name === "href" && value.indexOf( "#" ) !== -1 ) {
this.hash = value.substring( value.indexOf( "#" ));
}
}
Metadata
Metadata
Assignees
Labels
No labels