diff -r 8994d24e4b2f -r 0d2d10bc47bd src/cm/media/js/client/c_toc.js --- a/src/cm/media/js/client/c_toc.js Mon May 21 16:50:42 2012 +0200 +++ b/src/cm/media/js/client/c_toc.js Thu May 24 10:03:52 2012 +0200 @@ -71,12 +71,7 @@ gToc['animationShow'] = animationShow ; animationShow.set('to', { opacity: 1}); gToc['animationShow-handle'] = animationShow.on('end', onTocShowAnimEnd, gToc); - if (typeof document.getElementsByClassName!='function') { - document.querySelectorAll('.c-toc')[0].style.width = width + 'px'; - } - else { - document.getElementsByClassName('c-toc')[0].style.width = width + 'px'; - } + getElementsByClassName('c-toc')[0].style.width = width + 'px'; } toggleTocFn = function() { @@ -136,3 +131,82 @@ } return resultArray; } + +/* + Developed by Robert Nyman, http://www.robertnyman.com + Code/licensing: http://code.google.com/p/getelementsbyclassname/ +*/ +var getElementsByClassName = function (className, tag, elm){ + if (document.getElementsByClassName) { + getElementsByClassName = function (className, tag, elm) { + elm = elm || document; + var elements = elm.getElementsByClassName(className), + nodeName = (tag)? new RegExp("\\b" + tag + "\\b", "i") : null, + returnElements = [], + current; + for(var i=0, il=elements.length; i