]>
Commit | Line | Data |
---|---|---|
4744cb0e TL |
1 | $.fn.ready(function() { |
2 | ||
3 | var $listmode = $('#listmode'), | |
e68348f6 | 4 | $listentries = $("#list-entries"); |
4744cb0e TL |
5 | |
6 | /* ========================================================================== | |
7 | Menu | |
8 | ========================================================================== */ | |
36a733af MR |
9 | |
10 | $("#menu").click(function(){ | |
11 | $("#links").toggle(); | |
12 | }); | |
13 | ||
4744cb0e TL |
14 | /* ========================================================================== |
15 | List mode or Table Mode | |
16 | ========================================================================== */ | |
36a733af | 17 | |
4744cb0e | 18 | $listmode.click(function(){ |
36a733af | 19 | if ( $.cookie("listmode") == 1 ) { |
4744cb0e | 20 | // Cookie |
36a733af | 21 | $.removeCookie("listmode"); |
4744cb0e TL |
22 | |
23 | $listentries.removeClass("listmode"); | |
24 | $listmode.removeClass("tablemode"); | |
25 | $listmode.addClass("listmode"); | |
943ac3c7 | 26 | } |
36a733af | 27 | else { |
4744cb0e | 28 | // Cookie |
36a733af MR |
29 | $.cookie("listmode", 1, {expires: 365}); |
30 | ||
4744cb0e TL |
31 | $listentries.addClass("listmode"); |
32 | $listmode.removeClass("listmode"); | |
33 | $listmode.addClass("tablemode"); | |
36a733af MR |
34 | } |
35 | ||
943ac3c7 | 36 | }); |
36a733af | 37 | |
4744cb0e TL |
38 | /* ========================================================================== |
39 | Cookie listmode | |
40 | ========================================================================== */ | |
41 | ||
36a733af | 42 | if ( $.cookie("listmode") == 1 ) { |
4744cb0e TL |
43 | $listentries.addClass("listmode"); |
44 | $listmode.removeClass("listmode"); | |
45 | $listmode.addClass("tablemode"); | |
36a733af MR |
46 | } |
47 | ||
7339b0b0 | 48 | }); |