diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-04-03 14:42:03 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2014-04-03 14:42:03 +0200 |
commit | 0d67b00d5d3b7ce1b76b639dcc65c415a5f13439 (patch) | |
tree | 7c4d113bb1c3d90ef53e08138a2850576395780f /themes/baggy/js/init.js | |
parent | 99679d06884120c57f43b44e55e03595f1f87bed (diff) | |
parent | 7d2f1aa2793595aa6cdc58a58260184234cfa809 (diff) | |
download | wallabag-1.6.1.tar.gz wallabag-1.6.1.tar.zst wallabag-1.6.1.zip |
wallabag 1.6.0
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 | }); | ||