Browse code

improved javascript for code expansion

B Mathis authored on 12/11/2009 at 16:28:30
Showing 1 changed files
... ...
@@ -1,12 +1,7 @@
1 1
 window.addEvent('domready', function() {
2
-  addPreExpanders();
2
+  $$('div.highlight').each(addExpander);
3 3
 });
4 4
 
5
-function addPreExpanders(){
6
-  $$('div.highlight').each(function(div){
7
-    addExpander(div);
8
-  });
9
-}
10 5
 function addExpander(div){
11 6
   new Element('span',{
12 7
 		html: 'expand »',
... ...
@@ -29,6 +24,6 @@ function toggleExpander(){
29 29
     html = 'expand »';
30 30
   }
31 31
   $$('div.highlight span.pre_expander').each(function(span){
32
-    span.set('html',html);
32
+      span.set('html',html);
33 33
   });
34 34
 }
35 35
\ No newline at end of file