~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/static/javascript/custom.js

  • Committer: Martin Albisetti
  • Date: 2008-06-25 20:20:02 UTC
  • mto: (157.1.3 loggerhead)
  • mto: This revision was merged to the branch mainline in revision 187.
  • Revision ID: argentina@gmail.com-20080625202002-gtxnzryoqm8v594x
 * Make expanding diffs work
 * Cleanup some javascript

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
        item.getElement( '.expand_revisioninfo' ).addEvent( 'click', function()
12
12
            {
13
13
                expander.toggle();
14
 
                if(longDescription.style.display == 'none')
 
14
                if(!expander.open)
15
15
                {
16
16
                    longDescription.style.display = 'block';
17
17
                    shortDescription.style.display = 'none';
18
 
                    expand_icon.src = expand_icon.alt;
 
18
                    expand_icon.set('src', expand_icon.alt);
19
19
                }
20
20
                else
21
21
                {
22
22
                    longDescription.style.display = 'none';
23
23
                    shortDescription.style.display = 'block';
24
 
                    expand_icon.src = expand_icon.title;
 
24
                    expand_icon.set('src', expand_icon.title);
25
25
                }
26
26
            });
27
27
    });
28
28
 
29
 
    $$('.diff').each(function(item, i)
 
29
    $$('.diffBox').each(function(item, i)
30
30
    {
31
31
        // FIXME: Make less redundant
32
 
        var expander = new Fx.Slide( item.getElement( '.diffinfo' ), { duration: 200 } );
33
 
        var expand_icon = item.getElement( '.expand_icon' );
 
32
        var expander = new Fx.Slide( item.getNext( '.diffinfo' ), { duration: 200 } );
 
33
        var expand_icon = item.getElement( '.expand_diff' );
34
34
        item.getElement( '.expand_diff' ).addEvent( 'click', function()
35
35
            {
36
36
                expander.toggle();
37
 
                /*if(longDescription.style.display == 'none')
 
37
                if(!expander.open)
38
38
                {
39
 
                    expand_icon.src = expand_icon.alt;
 
39
                    expand_icon.set = ('src', expand_icon.alt);
40
40
                }
41
41
                else
42
42
                {
43
 
                    expand_icon.src = expand_icon.title;
44
 
                }*/
 
43
                    expand_icon.set = ('src', expand_icon.title);
 
44
                }
45
45
            });
46
46
    });
47
47