mirror of
https://github.com/wallabag/wallabag.git
synced 2024-10-31 22:28:54 +00:00
af61cb80eb
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
35 lines
935 B
JavaScript
35 lines
935 B
JavaScript
import $ from '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 default toggleSaveLinkForm;
|