aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Resources/static/themes/baggy/js/uiTools.js
diff options
context:
space:
mode:
authorPaulino Michelazzo <paulino@michelazzo.com.br>2016-10-18 22:48:23 +0200
committerPaulino Michelazzo <paulino@michelazzo.com.br>2016-10-18 22:48:23 +0200
commit99731f0bb1f6fd2815eeb9af504ce86df927657b (patch)
treeb080efc608d2bbd52b77a4a0067402007f50c5a8 /app/Resources/static/themes/baggy/js/uiTools.js
parent3a3c6b866b52721431bed22426d9abfcd0d2dfe0 (diff)
parent7180aaed45dce62e40620a9e4b202526ebd6a3bb (diff)
downloadwallabag-99731f0bb1f6fd2815eeb9af504ce86df927657b.tar.gz
wallabag-99731f0bb1f6fd2815eeb9af504ce86df927657b.tar.zst
wallabag-99731f0bb1f6fd2815eeb9af504ce86df927657b.zip
Merge remote-tracking branch 'wallabag/master'
Diffstat (limited to 'app/Resources/static/themes/baggy/js/uiTools.js')
-rw-r--r--app/Resources/static/themes/baggy/js/uiTools.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/app/Resources/static/themes/baggy/js/uiTools.js b/app/Resources/static/themes/baggy/js/uiTools.js
new file mode 100644
index 00000000..900b2707
--- /dev/null
+++ b/app/Resources/static/themes/baggy/js/uiTools.js
@@ -0,0 +1,35 @@
1const $ = require('jquery');
2
3function toggleSaveLinkForm(url, event) {
4 $('#add-link-result').empty();
5
6 const $bagit = $('#bagit');
7 const $bagitForm = $('#bagit-form');
8
9 $bagit.toggleClass('active-current');
10
11 // only if bag-it link is not presented on page
12 if ($bagit.length === 0) {
13 if (event !== 'undefined' && event) {
14 $bagitForm.css({ position: 'absolute', top: event.pageY, left: event.pageX - 200 });
15 } else {
16 $bagitForm.css({ position: 'relative', top: 'auto', left: 'auto' });
17 }
18 }
19
20 const searchForm = $('#search-form');
21 const plainUrl = $('#plainurl');
22 if (searchForm.length !== 0) {
23 $('#search').removeClass('current');
24 $('#search-arrow').removeClass('arrow-down');
25 searchForm.hide();
26 }
27 $bagitForm.toggle();
28 $('#content').toggleClass('opacity03');
29 if (url !== 'undefined' && url) {
30 plainUrl.val(url);
31 }
32 plainUrl.focus();
33}
34
35export { toggleSaveLinkForm };