diff options
author | Simounet <contact@simounet.net> | 2017-12-28 23:27:45 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2018-01-12 10:07:46 +0100 |
commit | 91f5992423bb69d518f9f4ed17cab36a765fcd13 (patch) | |
tree | 3a78417578ad16ad2b4c6c56ef3766776744b3ba /app/Resources/static | |
parent | 2831e77cce6eae213c0cec8f5a90a6a00c383633 (diff) | |
download | wallabag-91f5992423bb69d518f9f4ed17cab36a765fcd13.tar.gz wallabag-91f5992423bb69d518f9f4ed17cab36a765fcd13.tar.zst wallabag-91f5992423bb69d518f9f4ed17cab36a765fcd13.zip |
Close add entry and search nav JS action improved
Diffstat (limited to 'app/Resources/static')
-rwxr-xr-x | app/Resources/static/themes/material/index.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/app/Resources/static/themes/material/index.js b/app/Resources/static/themes/material/index.js index bdccc534..96310d81 100755 --- a/app/Resources/static/themes/material/index.js +++ b/app/Resources/static/themes/material/index.js | |||
@@ -35,6 +35,13 @@ $(document).ready(() => { | |||
35 | initFilters(); | 35 | initFilters(); |
36 | initExport(); | 36 | initExport(); |
37 | 37 | ||
38 | const toggleNav = (toShow, toFocus) => { | ||
39 | $('.nav-panel-actions').hide(100); | ||
40 | $(toShow).show(100); | ||
41 | $('.nav-panels').css('background', 'white'); | ||
42 | $(toFocus).focus(); | ||
43 | }; | ||
44 | |||
38 | $('#nav-btn-add-tag').on('click', () => { | 45 | $('#nav-btn-add-tag').on('click', () => { |
39 | $('.nav-panel-add-tag').toggle(100); | 46 | $('.nav-panel-add-tag').toggle(100); |
40 | $('.nav-panel-menu').addClass('hidden'); | 47 | $('.nav-panel-menu').addClass('hidden'); |
@@ -42,10 +49,7 @@ $(document).ready(() => { | |||
42 | return false; | 49 | return false; |
43 | }); | 50 | }); |
44 | $('#nav-btn-add').on('click', () => { | 51 | $('#nav-btn-add').on('click', () => { |
45 | $('.nav-panel-actions').hide(100); | 52 | toggleNav('.nav-panel-add', '#entry_url'); |
46 | $('.nav-panel-add').show(100); | ||
47 | $('.nav-panels').css('background', 'white'); | ||
48 | $('#entry_url').focus(); | ||
49 | return false; | 53 | return false; |
50 | }); | 54 | }); |
51 | const materialAddForm = $('.nav-panel-add'); | 55 | const materialAddForm = $('.nav-panel-add'); |
@@ -54,15 +58,11 @@ $(document).ready(() => { | |||
54 | $('input#entry_url', materialAddForm).prop('readonly', true).trigger('blur'); | 58 | $('input#entry_url', materialAddForm).prop('readonly', true).trigger('blur'); |
55 | }); | 59 | }); |
56 | $('#nav-btn-search').on('click', () => { | 60 | $('#nav-btn-search').on('click', () => { |
57 | $('.nav-panel-actions').hide(100); | 61 | toggleNav('.nav-panel-search', '#search_entry_term'); |
58 | $('.nav-panel-search').show(100); | ||
59 | $('.nav-panels').css('background', 'white'); | ||
60 | $('#search_entry_term').focus(); | ||
61 | return false; | 62 | return false; |
62 | }); | 63 | }); |
63 | $('.close').on('click', () => { | 64 | $('.close').on('click', (e) => { |
64 | $('.nav-panel-add').hide(100); | 65 | $(e.target).parent('.nav-panel-item').hide(100); |
65 | $('.nav-panel-search').hide(100); | ||
66 | $('.nav-panel-actions').show(100); | 66 | $('.nav-panel-actions').show(100); |
67 | $('.nav-panels').css('background', 'transparent'); | 67 | $('.nav-panels').css('background', 'transparent'); |
68 | return false; | 68 | return false; |