diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2019-05-29 11:14:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-29 11:14:00 +0200 |
commit | 73ec68b1ffafb792265a3805833e5cd84c966aed (patch) | |
tree | 33c6040c050f85c537f8dbf5e91d8c281db092cd /app/Resources/static/themes/_global/index.js | |
parent | 2ba365c7c49556cd23b444dc3bb8d4a8cf08809d (diff) | |
parent | 2cbee36a0184786644470a84fdd8c720cfcac58e (diff) | |
download | wallabag-73ec68b1ffafb792265a3805833e5cd84c966aed.tar.gz wallabag-73ec68b1ffafb792265a3805833e5cd84c966aed.tar.zst wallabag-73ec68b1ffafb792265a3805833e5cd84c966aed.zip |
Merge pull request #3984 from wallabag/2.4
Merge 2.4 into master
Diffstat (limited to 'app/Resources/static/themes/_global/index.js')
-rw-r--r-- | app/Resources/static/themes/_global/index.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/app/Resources/static/themes/_global/index.js b/app/Resources/static/themes/_global/index.js index ae598e56..9ad96fc0 100644 --- a/app/Resources/static/themes/_global/index.js +++ b/app/Resources/static/themes/_global/index.js | |||
@@ -70,4 +70,41 @@ $(document).ready(() => { | |||
70 | retrievePercent(x.entryId, true); | 70 | retrievePercent(x.entryId, true); |
71 | }); | 71 | }); |
72 | } | 72 | } |
73 | |||
74 | document.querySelectorAll('[data-handler=tag-rename]').forEach((item) => { | ||
75 | const current = item; | ||
76 | current.wallabag_edit_mode = false; | ||
77 | current.onclick = (event) => { | ||
78 | const target = event.currentTarget; | ||
79 | |||
80 | if (target.wallabag_edit_mode === false) { | ||
81 | $(target.parentNode.querySelector('[data-handle=tag-link]')).addClass('hidden'); | ||
82 | $(target.parentNode.querySelector('[data-handle=tag-rename-form]')).removeClass('hidden'); | ||
83 | target.parentNode.querySelector('[data-handle=tag-rename-form] input').focus(); | ||
84 | target.querySelector('.material-icons').innerHTML = 'done'; | ||
85 | |||
86 | target.wallabag_edit_mode = true; | ||
87 | } else { | ||
88 | target.parentNode.querySelector('[data-handle=tag-rename-form]').submit(); | ||
89 | } | ||
90 | }; | ||
91 | }); | ||
92 | |||
93 | // mimic radio button because emailTwoFactor is a boolean | ||
94 | $('#update_user_googleTwoFactor').on('change', () => { | ||
95 | $('#update_user_emailTwoFactor').prop('checked', false); | ||
96 | }); | ||
97 | |||
98 | $('#update_user_emailTwoFactor').on('change', () => { | ||
99 | $('#update_user_googleTwoFactor').prop('checked', false); | ||
100 | }); | ||
101 | |||
102 | // same mimic for super admin | ||
103 | $('#user_googleTwoFactor').on('change', () => { | ||
104 | $('#user_emailTwoFactor').prop('checked', false); | ||
105 | }); | ||
106 | |||
107 | $('#user_emailTwoFactor').on('change', () => { | ||
108 | $('#user_googleTwoFactor').prop('checked', false); | ||
109 | }); | ||
73 | }); | 110 | }); |