Skip to content

Commit

Permalink
MINOR Added prototypefix helper scripts from jquery13 module to fix d…
Browse files Browse the repository at this point in the history
…ocument.getElementsByClassName() override by prototypejs

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92548 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
chillu committed Nov 21, 2009
1 parent 76d2886 commit 32c44b0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions javascript/prototypefix/README
@@ -0,0 +1,7 @@
Prototype replaces document.getElementsByClassName with it's own version. However many browsers
now come with their own implementation, and prototype's is much slower.

This fixes this by restoring the original after prototype is loaded.

@todo: Safari 3 used to come with a broken document.getElementsByClassName. We should use
the same checks jQuery does and not restore the function if it doesn't work the same as the spec.
1 change: 1 addition & 0 deletions javascript/prototypefix/intro.js
@@ -0,0 +1 @@
var browserGetElementsByClassName = document.getElementsByClassName;
1 change: 1 addition & 0 deletions javascript/prototypefix/outro.js
@@ -0,0 +1 @@
if (browserGetElementsByClassName) document.getElementsByClassName = browserGetElementsByClassName;

0 comments on commit 32c44b0

Please sign in to comment.