diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources/views/themes/material/public/js')
-rwxr-xr-x | src/Wallabag/CoreBundle/Resources/views/themes/material/public/js/init.js | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/public/js/init.js b/src/Wallabag/CoreBundle/Resources/views/themes/material/public/js/init.js index 9341cb5a..c0700c2c 100755 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/public/js/init.js +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/public/js/init.js | |||
@@ -1,3 +1,15 @@ | |||
1 | function init_filters() { | ||
2 | // no display if filters not aviable | ||
3 | if ($("div").is("#filters")) { | ||
4 | $('#button_filters').show(); | ||
5 | $('.button-collapse-right').sideNav({ edge: 'right' }); | ||
6 | $('#clear_form_filters').on('click', function(){ | ||
7 | $('#filters input').val(''); | ||
8 | return false; | ||
9 | }); | ||
10 | } | ||
11 | } | ||
12 | |||
1 | $(document).ready(function(){ | 13 | $(document).ready(function(){ |
2 | // sideNav | 14 | // sideNav |
3 | $('.button-collapse').sideNav(); | 15 | $('.button-collapse').sideNav(); |
@@ -5,18 +17,25 @@ $(document).ready(function(){ | |||
5 | $('.collapsible').collapsible({ | 17 | $('.collapsible').collapsible({ |
6 | accordion : false | 18 | accordion : false |
7 | }); | 19 | }); |
20 | $('.datepicker').pickadate({ | ||
21 | selectMonths: true, | ||
22 | selectYears: 15, | ||
23 | formatSubmit: 'dd/mm/yyyy', | ||
24 | hiddenName: true, | ||
25 | format: 'dd/mm/yyyy', | ||
26 | }); | ||
27 | init_filters(); | ||
8 | 28 | ||
9 | $('#nav-btn-add').click(function(){ | 29 | $('#nav-btn-add').on('click', function(){ |
10 | $(".nav-panel-buttom").hide(100); | 30 | $(".nav-panel-buttom").hide(100); |
11 | $(".nav-panel-add").show(100); | 31 | $(".nav-panel-add").show(100); |
12 | $(".nav-panel-menu").hide(100); | ||
13 | $(".nav-panels .action").hide(100); | 32 | $(".nav-panels .action").hide(100); |
14 | $(".nav-panel-menu").addClass('hidden'); | 33 | $(".nav-panel-menu").addClass('hidden'); |
15 | $(".nav-panels").css('background', 'white'); | 34 | $(".nav-panels").css('background', 'white'); |
16 | $("#entry_url").focus(); | 35 | $("#entry_url").focus(); |
17 | return false; | 36 | return false; |
18 | }); | 37 | }); |
19 | $('#nav-btn-search').click(function(){ | 38 | $('#nav-btn-search').on('click', function(){ |
20 | $(".nav-panel-buttom").hide(100); | 39 | $(".nav-panel-buttom").hide(100); |
21 | $(".nav-panel-search").show(100); | 40 | $(".nav-panel-search").show(100); |
22 | $(".nav-panels .action").hide(100); | 41 | $(".nav-panels .action").hide(100); |
@@ -25,7 +44,7 @@ $(document).ready(function(){ | |||
25 | $("#searchfield").focus(); | 44 | $("#searchfield").focus(); |
26 | return false; | 45 | return false; |
27 | }); | 46 | }); |
28 | $('.mdi-navigation-close').click(function(){ | 47 | $('.mdi-navigation-close').on('click', function(){ |
29 | $(".nav-panel-add").hide(100); | 48 | $(".nav-panel-add").hide(100); |
30 | $(".nav-panel-search").hide(100); | 49 | $(".nav-panel-search").hide(100); |
31 | $(".nav-panel-buttom").show(100); | 50 | $(".nav-panel-buttom").show(100); |
@@ -34,4 +53,11 @@ $(document).ready(function(){ | |||
34 | $(".nav-panels").css('background', 'transparent'); | 53 | $(".nav-panels").css('background', 'transparent'); |
35 | return false; | 54 | return false; |
36 | }); | 55 | }); |
56 | $(window).scroll(function () { | ||
57 | var s = $(window).scrollTop(), | ||
58 | d = $(document).height(), | ||
59 | c = $(window).height(); | ||
60 | var scrollPercent = (s / (d-c)) * 100; | ||
61 | $(".progress .determinate").css('width', scrollPercent+'%'); | ||
62 | }); | ||
37 | }); | 63 | }); |