Skip to content

Commit

Permalink
comments and spell check
Browse files Browse the repository at this point in the history
  • Loading branch information
uniqname committed Jan 14, 2012
1 parent c62640e commit d5fe92e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php */

The goal of this project is to produce a polyfill that conforms to the w3c spec as closely as possible not only in user intercation, but also in application interaction and markup.
The goal of this project is to produce a polyfill that conforms to the W3C spec as closely as possible not only in user interaction, but also in application interaction and markup.

My initial desire was to create an independant polyfil, but time requirements lead me to an initial jQuery dependant version. I was able to follow that up with a completely independant version, but I still need to do lots of testing.
My initial desire was to create an independent polyfill, but time requirements lead me to an initial jQuery dependent version. I was able to follow that up with a completely independent version, but I still need to do lots of testing.

Any recommendations would be extremely welcome.

One thing to keep in mind. This polyfill does not test for existing functionality. The intent is that the client will do the test and conditionally load this polyfill to provide backward compatability.
One thing to keep in mind. This polyfill does not test for existing functionality. The intent is that the client will do the test and conditionally load this polyfill to provide backward compatibility.

Cory
7 changes: 5 additions & 2 deletions details.polyfill.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
addRule = function (styleTag, rule) {
rule = '\n' + rule;
if (styleTag.nodeName.toLowerCase() === 'style') {
if (styleTag.styleSheet && styleTag.styleSheet.cssText !== undefined) { //for ie
if (styleTag.styleSheet && styleTag.styleSheet.cssText !== undefined) { //for MSIE
styleTag.styleSheet.cssText = rule;
} else { styleTag.appendChild(doc.createTextNode(rule)); }
}
Expand All @@ -36,7 +36,7 @@
break;
}
}
//Double check we didn't fail in finding a deatils element
//Double check we didn't fail in finding a details element
if (detailElmnt) {
//toggle the open attribute
if (detailElmnt.getAttribute('open')) {
Expand All @@ -62,10 +62,13 @@
'details[data-detailsid="' + detailsID + '"][open] { height: auto; }');
}
headElem.appendChild(detailStyleTag);
//W3C
if (bodyElem.addEventListener) {
bodyElem.addEventListener('click', toggle, false);
//IE
} else if (bodyElem.attachEvent) {
bodyElem.attachEvent('onclick', toggle);
// Don't overwrite a preexisting "onclick" attribute.
} else if (bodyElem.onclick === null) {
bodyElem.onclick = toggle;
}
Expand Down

0 comments on commit d5fe92e

Please sign in to comment.