]>
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(){ | |
ebea829d | 11 | $("#links").toggleClass('menu--open'); |
1772de25 JS |
12 | if ($('#content').hasClass('opacity03')) { |
13 | $('#content').removeClass('opacity03'); | |
14 | } | |
36a733af MR |
15 | }); |
16 | ||
4744cb0e TL |
17 | /* ========================================================================== |
18 | List mode or Table Mode | |
19 | ========================================================================== */ | |
36a733af | 20 | |
4744cb0e | 21 | $listmode.click(function(){ |
36a733af | 22 | if ( $.cookie("listmode") == 1 ) { |
4744cb0e | 23 | // Cookie |
36a733af | 24 | $.removeCookie("listmode"); |
4744cb0e TL |
25 | |
26 | $listentries.removeClass("listmode"); | |
27 | $listmode.removeClass("tablemode"); | |
28 | $listmode.addClass("listmode"); | |
943ac3c7 | 29 | } |
36a733af | 30 | else { |
4744cb0e | 31 | // Cookie |
36a733af MR |
32 | $.cookie("listmode", 1, {expires: 365}); |
33 | ||
4744cb0e TL |
34 | $listentries.addClass("listmode"); |
35 | $listmode.removeClass("listmode"); | |
36 | $listmode.addClass("tablemode"); | |
36a733af MR |
37 | } |
38 | ||
943ac3c7 | 39 | }); |
36a733af | 40 | |
4744cb0e TL |
41 | /* ========================================================================== |
42 | Cookie listmode | |
43 | ========================================================================== */ | |
44 | ||
36a733af | 45 | if ( $.cookie("listmode") == 1 ) { |
4744cb0e TL |
46 | $listentries.addClass("listmode"); |
47 | $listmode.removeClass("listmode"); | |
48 | $listmode.addClass("tablemode"); | |
36a733af MR |
49 | } |
50 | ||
7339b0b0 | 51 | }); |