X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=themes%2Fdefault%2Fjs%2FpopupForm.js;h=d233e600f3d837d0bac1bf7c2bae5aa1c7bbcd3c;hb=d0287608b6d34f36caafbf699d44337052a0fe3d;hp=06be3f0cdced6fd923d72af5b3e9d1cdb49e6641;hpb=17065e613fde7c4226df66e4a1c57784190f29e1;p=github%2Fwallabag%2Fwallabag.git diff --git a/themes/default/js/popupForm.js b/themes/default/js/popupForm.js index 06be3f0c..d233e600 100644 --- a/themes/default/js/popupForm.js +++ b/themes/default/js/popupForm.js @@ -1,20 +1,72 @@ $(document).ready(function() { $("#search-form").hide(); + $("#bagit-form").hide(); - function closeSearch() { + //--------------------------------------------------------------------------- + // Toggle the "Search" popup in the sidebar + //--------------------------------------------------------------------------- + function toggleSearch() { $("#search-form").toggle(); $("#search").toggleClass("current"); + $("#search").toggleClass("active-current"); $("#search-arrow").toggleClass("arrow-down"); + if ($("#search").hasClass("current")) { + $("#content").addClass("opacity03"); + } else { + $("#content").removeClass("opacity03"); + } + } + + //--------------------------------------------------------------------------- + // Toggle the "Save a Link" popup in the sidebar + //--------------------------------------------------------------------------- + function toggleBagit() { + $("#bagit-form").toggle(); + $("#bagit").toggleClass("current"); + $("#bagit").toggleClass("active-current"); + $("#bagit-arrow").toggleClass("arrow-down"); + if ($("#bagit").hasClass("current")) { + $("#content").addClass("opacity03"); + } else { + $("#content").removeClass("opacity03"); + } + } + + //--------------------------------------------------------------------------- + // Close all #links popups in the sidebar + //--------------------------------------------------------------------------- + function closePopups() { + $("#links .messages").hide(); + $("#links > li > a").removeClass("active-current"); + $("#links > li > a").removeClass("current"); + $("[id$=-arrow]").removeClass("arrow-down"); + $("#content").removeClass("opacity03"); } $("#search").click(function(){ - closeSearch(); + closePopups(); + toggleSearch(); + $("#searchfield").focus(); + }); + + $("#bagit").click(function(){ + closePopups(); + toggleBagit(); + $("#plainurl").focus(); }); $("#search-form-close").click(function(){ - closeSearch(); + toggleSearch(); + }); + + $("#bagit-form-close").click(function(){ + toggleBagit(); }); + // $("#").click(function(){ + // toggleSearch(); + // }); + -}); \ No newline at end of file +});