]>
Commit | Line | Data |
---|---|---|
3945335f NL |
1 | $(document).ready(function() { |
2 | ||
3 | $("#search-form").hide(); | |
ff02fd8a | 4 | $("#bagit-form").hide(); |
3945335f | 5 | |
ff02fd8a JS |
6 | //--------------------------------------------------------------------------- |
7 | // Toggle the "Search" popup in the sidebar | |
8 | //--------------------------------------------------------------------------- | |
9 | function toggleSearch() { | |
3945335f NL |
10 | $("#search-form").toggle(); |
11 | $("#search").toggleClass("current"); | |
ff02fd8a | 12 | $("#search").toggleClass("active-current"); |
3945335f | 13 | $("#search-arrow").toggleClass("arrow-down"); |
ff02fd8a JS |
14 | if ($("#search").hasClass("current")) { |
15 | $("#content").addClass("opacity03"); | |
16 | } else { | |
17 | $("#content").removeClass("opacity03"); | |
18 | } | |
3945335f NL |
19 | } |
20 | ||
ff02fd8a JS |
21 | //--------------------------------------------------------------------------- |
22 | // Toggle the "Save a Link" popup in the sidebar | |
23 | //--------------------------------------------------------------------------- | |
24 | function toggleBagit() { | |
25 | $("#bagit-form").toggle(); | |
26 | $("#bagit").toggleClass("current"); | |
27 | $("#bagit").toggleClass("active-current"); | |
28 | $("#bagit-arrow").toggleClass("arrow-down"); | |
29 | if ($("#bagit").hasClass("current")) { | |
30 | $("#content").addClass("opacity03"); | |
31 | } else { | |
32 | $("#content").removeClass("opacity03"); | |
48fb171d | 33 | } |
ff02fd8a JS |
34 | } |
35 | ||
36 | //--------------------------------------------------------------------------- | |
37 | // Close all #links popups in the sidebar | |
38 | //--------------------------------------------------------------------------- | |
39 | function closePopups() { | |
40 | $("#links .messages").hide(); | |
41 | $("#links > li > a").removeClass("active-current"); | |
42 | $("#links > li > a").removeClass("current"); | |
43 | $("[id$=-arrow]").removeClass("arrow-down"); | |
44 | $("#content").removeClass("opacity03"); | |
45 | } | |
46 | ||
47 | $("#search").click(function(){ | |
48 | closePopups(); | |
49 | toggleSearch(); | |
50 | $("#searchfield").focus(); | |
51 | }); | |
52 | ||
53 | $("#bagit").click(function(){ | |
54 | closePopups(); | |
55 | toggleBagit(); | |
56 | $("#plainurl").focus(); | |
3945335f NL |
57 | }); |
58 | ||
59 | $("#search-form-close").click(function(){ | |
ff02fd8a | 60 | toggleSearch(); |
3945335f NL |
61 | }); |
62 | ||
ff02fd8a JS |
63 | $("#bagit-form-close").click(function(){ |
64 | toggleBagit(); | |
65 | }); | |
66 | ||
67 | // $("#").click(function(){ | |
68 | // toggleSearch(); | |
69 | // }); | |
70 | ||
3945335f | 71 | |
ff02fd8a | 72 | }); |