diff options
author | Thomas Citharel <tcit@tcit.fr> | 2016-09-28 10:30:18 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2016-09-28 10:30:18 +0200 |
commit | c146f6940a176142084b4fc3c610d13aca60d90e (patch) | |
tree | 7bc4683febcf15a4fd6053bddd49e36c202adeda /app/Resources/static/themes/baggy/js/uiTools.js | |
parent | 55345331c47ca6f389e38a842584c3062476601d (diff) | |
download | wallabag-c146f6940a176142084b4fc3c610d13aca60d90e.tar.gz wallabag-c146f6940a176142084b4fc3c610d13aca60d90e.tar.zst wallabag-c146f6940a176142084b4fc3c610d13aca60d90e.zip |
Assets work
* ES6 all the things !
* ESLint checks everything
* CSS fixes (use stylelint)
* Fix #2231
Diffstat (limited to 'app/Resources/static/themes/baggy/js/uiTools.js')
-rw-r--r-- | app/Resources/static/themes/baggy/js/uiTools.js | 35 |
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 @@ | |||
1 | const $ = require('jquery'); | ||
2 | |||
3 | function 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 | |||
35 | export { toggleSaveLinkForm }; | ||