mirror of
https://github.com/wallabag/wallabag.git
synced 2025-07-22 17:18:37 +00:00
_global-izing some more js & css
This commit is contained in:
parent
db3bffa284
commit
eb365a01fb
16 changed files with 14 additions and 14 deletions
72
themes/_global/js/popupForm.js
Normal file
72
themes/_global/js/popupForm.js
Normal file
|
@ -0,0 +1,72 @@
|
|||
$(document).ready(function() {
|
||||
|
||||
$("#search-form").hide();
|
||||
$("#bagit-form").hide();
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// 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(){
|
||||
closePopups();
|
||||
toggleSearch();
|
||||
$("#searchfield").focus();
|
||||
});
|
||||
|
||||
$("#bagit").click(function(){
|
||||
closePopups();
|
||||
toggleBagit();
|
||||
$("#plainurl").focus();
|
||||
});
|
||||
|
||||
$("#search-form-close").click(function(){
|
||||
toggleSearch();
|
||||
});
|
||||
|
||||
$("#bagit-form-close").click(function(){
|
||||
toggleBagit();
|
||||
});
|
||||
|
||||
// $("#").click(function(){
|
||||
// toggleSearch();
|
||||
// });
|
||||
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue