mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-26 02:51:04 +00:00
Close add entry and search nav JS action improved
This commit is contained in:
parent
2831e77cce
commit
91f5992423
2 changed files with 12 additions and 12 deletions
|
@ -35,6 +35,13 @@ $(document).ready(() => {
|
|||
initFilters();
|
||||
initExport();
|
||||
|
||||
const toggleNav = (toShow, toFocus) => {
|
||||
$('.nav-panel-actions').hide(100);
|
||||
$(toShow).show(100);
|
||||
$('.nav-panels').css('background', 'white');
|
||||
$(toFocus).focus();
|
||||
};
|
||||
|
||||
$('#nav-btn-add-tag').on('click', () => {
|
||||
$('.nav-panel-add-tag').toggle(100);
|
||||
$('.nav-panel-menu').addClass('hidden');
|
||||
|
@ -42,10 +49,7 @@ $(document).ready(() => {
|
|||
return false;
|
||||
});
|
||||
$('#nav-btn-add').on('click', () => {
|
||||
$('.nav-panel-actions').hide(100);
|
||||
$('.nav-panel-add').show(100);
|
||||
$('.nav-panels').css('background', 'white');
|
||||
$('#entry_url').focus();
|
||||
toggleNav('.nav-panel-add', '#entry_url');
|
||||
return false;
|
||||
});
|
||||
const materialAddForm = $('.nav-panel-add');
|
||||
|
@ -54,15 +58,11 @@ $(document).ready(() => {
|
|||
$('input#entry_url', materialAddForm).prop('readonly', true).trigger('blur');
|
||||
});
|
||||
$('#nav-btn-search').on('click', () => {
|
||||
$('.nav-panel-actions').hide(100);
|
||||
$('.nav-panel-search').show(100);
|
||||
$('.nav-panels').css('background', 'white');
|
||||
$('#search_entry_term').focus();
|
||||
toggleNav('.nav-panel-search', '#search_entry_term');
|
||||
return false;
|
||||
});
|
||||
$('.close').on('click', () => {
|
||||
$('.nav-panel-add').hide(100);
|
||||
$('.nav-panel-search').hide(100);
|
||||
$('.close').on('click', (e) => {
|
||||
$(e.target).parent('.nav-panel-item').hide(100);
|
||||
$('.nav-panel-actions').show(100);
|
||||
$('.nav-panels').css('background', 'transparent');
|
||||
return false;
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue