]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - docs/js/custom.js
2 $('.aj-nav').click(function (e
) {
4 $(this).parent().siblings().find('ul').slideUp();
5 $(this).next().slideToggle();
8 // Bootstrap Table Class
9 $('table').addClass('table');
11 // Responsive menu spinner
12 $('#menu-spinner-button').click(function () {
13 $('#sub-nav-collapse').slideToggle();
16 // Catch browser resize
17 $(window
).resize(function () {
18 // Remove transition inline style on large screens
19 if ($(window
).width() >= 768)
20 $('#sub-nav-collapse').removeAttr('style');
24 //Fix GitHub Ribbon overlapping Scrollbar
25 var t
= $('#github-ribbon');
27 if (t
[0] && a
[0] && a
[0].scrollHeight
> $('.right-column').height()) t
[0].style
.right
= '16px';
29 //Toggle Code Block Visibility
30 function toggleCodeBlocks() {
31 var t
= localStorage
.getItem("toggleCodeStats")
33 localStorage
.setItem("toggleCodeStats", t
);
34 var a
= $('.content-page article');
35 var c
= a
.children().filter('pre');
36 var d
= $('.right-column');
37 if (d
.hasClass('float-view')) {
38 d
.removeClass('float-view');
39 $('#toggleCodeBlockBtn')[0].innerHTML
= "Hide Code Blocks";
41 if (c
.hasClass('hidden')) {
42 d
.addClass('float-view');
43 c
.removeClass('hidden');
44 $('#toggleCodeBlockBtn')[0].innerHTML
= "Show Code Blocks Inline";
47 $('#toggleCodeBlockBtn')[0].innerHTML
= "Show Code Blocks";
52 if (localStorage
.getItem("toggleCodeStats") >= 0) {
53 var t
= localStorage
.getItem("toggleCodeStats");
56 localStorage
.setItem("toggleCodeStats", 1);
61 localStorage
.setItem("toggleCodeStats", 2);
64 localStorage
.setItem("toggleCodeStats", 0);