diff options
Diffstat (limited to 'themes/baggy/js/init.js')
-rwxr-xr-x | themes/baggy/js/init.js | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/themes/baggy/js/init.js b/themes/baggy/js/init.js index c1d3c0ec..4a843548 100755 --- a/themes/baggy/js/init.js +++ b/themes/baggy/js/init.js | |||
@@ -1,12 +1,36 @@ | |||
1 | document.addEventListener('DOMContentLoaded', function() { | 1 | $(document).ready(function() { |
2 | var menu = document.getElementById('menu'); | 2 | |
3 | 3 | $("#menu").click(function(){ | |
4 | menu.addEventListener('click', function(){ | 4 | $("#links").toggle(); |
5 | if(this.nextElementSibling.style.display === "block") { | 5 | }); |
6 | this.nextElementSibling.style.display = "none"; | 6 | |
7 | }else { | 7 | |
8 | this.nextElementSibling.style.display = "block"; | 8 | $("#listmode").click(function(){ |
9 | if ( $.cookie("listmode") == 1 ) { | ||
10 | $(".entrie").css("width", ""); | ||
11 | $(".entrie").css("margin-left", ""); | ||
12 | |||
13 | $.removeCookie("listmode"); | ||
14 | $("#listmode").removeClass("tablemode"); | ||
15 | $("#listmode").addClass("listmode"); | ||
9 | } | 16 | } |
10 | 17 | else { | |
18 | $.cookie("listmode", 1, {expires: 365}); | ||
19 | |||
20 | $(".entrie").css("width", "100%"); | ||
21 | $(".entrie").css("margin-left", "0"); | ||
22 | $("#listmode").removeClass("listmode"); | ||
23 | $("#listmode").addClass("tablemode"); | ||
24 | } | ||
25 | |||
11 | }); | 26 | }); |
12 | }); \ No newline at end of file | 27 | |
28 | if ( $.cookie("listmode") == 1 ) { | ||
29 | $(".entrie").css("width", "100%"); | ||
30 | $(".entrie").css("margin-left", "0"); | ||
31 | $("#listmode").removeClass("listmode"); | ||
32 | $("#listmode").addClass("tablemode"); | ||
33 | } | ||
34 | |||
35 | |||
36 | }); | ||