Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

More lenient className testing.

  • Loading branch information...
commit 720df4ea40752bb4a829bb19884845ed922cb665 1 parent 3ea0147
@kangax authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 master.js
View
6 master.js
@@ -107,16 +107,16 @@
var target = ('target' in e) ? e.target : e.srcElement;
if (target && /^a$/i.test(target.nodeName)) {
- if (target.className === 'show-test-code') {
+ if ((' ' + target.className + ' ').indexOf(' show-test-code ') > -1) {
toggleCodeSection(target);
}
- else if (target.className === 'show-all') {
+ else if ((' ' + target.className + ' ').indexOf(' show-all ') > -1) {
var all = document.getElementsByClassName('show-test-code');
for (var i=0, len=all.length; i<len; i++) {
toggleCodeSection(all[i], 'show');
}
}
- else if (target.className === 'hide-all') {
+ else if ((' ' + target.className + ' ').indexOf(' hide-all ') > -1) {
var all = document.getElementsByClassName('show-test-code');
for (var i=0, len=all.length; i<len; i++) {
toggleCodeSection(all[i], 'hide');
Please sign in to comment.
Something went wrong with that request. Please try again.