diff options
Diffstat (limited to 'themes/baggy/js/init.js')
-rwxr-xr-x | themes/baggy/js/init.js | 56 |
1 files changed, 46 insertions, 10 deletions
diff --git a/themes/baggy/js/init.js b/themes/baggy/js/init.js index c1d3c0ec..00470fbf 100755 --- a/themes/baggy/js/init.js +++ b/themes/baggy/js/init.js | |||
@@ -1,12 +1,48 @@ | |||
1 | document.addEventListener('DOMContentLoaded', function() { | 1 | $.fn.ready(function() { |
2 | var menu = document.getElementById('menu'); | 2 | |
3 | 3 | var $listmode = $('#listmode'), | |
4 | menu.addEventListener('click', function(){ | 4 | $listentries = $("#list-entries"); |
5 | if(this.nextElementSibling.style.display === "block") { | 5 | |
6 | this.nextElementSibling.style.display = "none"; | 6 | /* ========================================================================== |
7 | }else { | 7 | Menu |
8 | this.nextElementSibling.style.display = "block"; | 8 | ========================================================================== */ |
9 | |||
10 | $("#menu").click(function(){ | ||
11 | $("#links").toggle(); | ||
12 | }); | ||
13 | |||
14 | /* ========================================================================== | ||
15 | List mode or Table Mode | ||
16 | ========================================================================== */ | ||
17 | |||
18 | $listmode.click(function(){ | ||
19 | if ( $.cookie("listmode") == 1 ) { | ||
20 | // Cookie | ||
21 | $.removeCookie("listmode"); | ||
22 | |||
23 | $listentries.removeClass("listmode"); | ||
24 | $listmode.removeClass("tablemode"); | ||
25 | $listmode.addClass("listmode"); | ||
9 | } | 26 | } |
10 | 27 | else { | |
28 | // Cookie | ||
29 | $.cookie("listmode", 1, {expires: 365}); | ||
30 | |||
31 | $listentries.addClass("listmode"); | ||
32 | $listmode.removeClass("listmode"); | ||
33 | $listmode.addClass("tablemode"); | ||
34 | } | ||
35 | |||
11 | }); | 36 | }); |
12 | }); \ No newline at end of file | 37 | |
38 | /* ========================================================================== | ||
39 | Cookie listmode | ||
40 | ========================================================================== */ | ||
41 | |||
42 | if ( $.cookie("listmode") == 1 ) { | ||
43 | $listentries.addClass("listmode"); | ||
44 | $listmode.removeClass("listmode"); | ||
45 | $listmode.addClass("tablemode"); | ||
46 | } | ||
47 | |||
48 | }); | ||