forked from wallabag/wallabag
Assets work
* ES6 all the things ! * ESLint checks everything * CSS fixes (use stylelint) * Fix #2231
This commit is contained in:
35
app/Resources/static/themes/baggy/js/uiTools.js
Normal file
35
app/Resources/static/themes/baggy/js/uiTools.js
Normal file
@ -0,0 +1,35 @@
|
||||
const $ = require('jquery');
|
||||
|
||||
function toggleSaveLinkForm(url, event) {
|
||||
$('#add-link-result').empty();
|
||||
|
||||
const $bagit = $('#bagit');
|
||||
const $bagitForm = $('#bagit-form');
|
||||
|
||||
$bagit.toggleClass('active-current');
|
||||
|
||||
// only if bag-it link is not presented on page
|
||||
if ($bagit.length === 0) {
|
||||
if (event !== 'undefined' && event) {
|
||||
$bagitForm.css({ position: 'absolute', top: event.pageY, left: event.pageX - 200 });
|
||||
} else {
|
||||
$bagitForm.css({ position: 'relative', top: 'auto', left: 'auto' });
|
||||
}
|
||||
}
|
||||
|
||||
const searchForm = $('#search-form');
|
||||
const plainUrl = $('#plainurl');
|
||||
if (searchForm.length !== 0) {
|
||||
$('#search').removeClass('current');
|
||||
$('#search-arrow').removeClass('arrow-down');
|
||||
searchForm.hide();
|
||||
}
|
||||
$bagitForm.toggle();
|
||||
$('#content').toggleClass('opacity03');
|
||||
if (url !== 'undefined' && url) {
|
||||
plainUrl.val(url);
|
||||
}
|
||||
plainUrl.focus();
|
||||
}
|
||||
|
||||
export { toggleSaveLinkForm };
|
||||
Reference in New Issue
Block a user