~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-17 23:17:39 UTC
  • mto: (157.1.3 loggerhead)
  • mto: This revision was merged to the branch mainline in revision 187.
  • Revision ID: argentina@gmail.com-20080617231739-2coh41c61qh0dhxn
 * Tweaked CSS to add some space in expanded view
 * Renames CSS clases to something more sensible
 * Now showing the full commit text when expanding view
 * Made collapse and expand all work
 * Stop using CSS and images from launchpad.net
 * Removed some obsolete code from the changelog template

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
{
3
3
    $$('.revision_log').each(function(item, i)
4
4
    {
 
5
        // Make less redundant
5
6
        var thisSlider = new Fx.Slide( item.getElement( '.revisioninfo' ), { duration: 200 } );
 
7
        var shortDescription = item.getElement( '.short_description' );
 
8
        var longDescription = item.getElement( '.long_description' );
6
9
        thisSlider.hide();
7
 
        item.getElement( '.expand_revisioninfo' ).addEvent( 'click', function(){ thisSlider.toggle(); } );
 
10
        item.getElement( '.expand_revisioninfo' ).addEvent( 'click', function()
 
11
            {
 
12
                thisSlider.toggle();
 
13
                if(longDescription.style.display == 'none')
 
14
                {
 
15
                    longDescription.style.display = 'block';
 
16
                    shortDescription.style.display = 'none';
 
17
                }
 
18
                else
 
19
                {
 
20
                    longDescription.style.display = 'none';
 
21
                    shortDescription.style.display = 'block';
 
22
                }
 
23
            } );
8
24
    });
9
25
 
10
26
});
11
27
 
 
28
function toggle_expand_all(action)
 
29
{
 
30
    $$('.revision_log').each(function(item, i)
 
31
    {
 
32
        // Make less redundant
 
33
        var thisSlider = new Fx.Slide( item.getElement( '.revisioninfo' ), { duration: 200 } );
 
34
        var shortDescription = item.getElement( '.short_description' );
 
35
        var longDescription = item.getElement( '.long_description' );
 
36
        if(action == 'close')
 
37
        {
 
38
            thisSlider.slideOut();
 
39
            $('expand_all').style.display = 'block';
 
40
            $('collapse_all').style.display = 'none';
 
41
 
 
42
        }
 
43
        else if(action == 'open')
 
44
        {
 
45
            thisSlider.slideIn();
 
46
            $('expand_all').style.display = 'none';
 
47
            $('collapse_all').style.display = 'block';
 
48
        }
 
49
                if(longDescription.style.display == 'none')
 
50
                {
 
51
                    longDescription.style.display = 'block';
 
52
                    shortDescription.style.display = 'none';
 
53
                }
 
54
                else
 
55
                {
 
56
                    longDescription.style.display = 'none';
 
57
                    shortDescription.style.display = 'block';
 
58
                }
 
59
    });
 
60
}