diff --git a/themes/baggy/_head.twig b/themes/baggy/_head.twig index 04898d850..be11673fe 100755 --- a/themes/baggy/_head.twig +++ b/themes/baggy/_head.twig @@ -12,4 +12,5 @@ <script src="{{ poche_url }}themes/{{theme}}/js/jquery.cookie.js"></script> <script src="{{ poche_url }}themes/{{theme}}/js/init.js"></script> <script src="{{ poche_url }}themes/default/js/saveLink.js"></script> + <script src="{{ poche_url }}themes/default/js/popupForm.js"></script> <script src="{{ poche_url }}themes/{{theme}}/js/closeMessage.js"></script> diff --git a/themes/baggy/_search-form.twig b/themes/baggy/_search-form.twig index 1fd4154e6..b8ac3bfa6 100644 --- a/themes/baggy/_search-form.twig +++ b/themes/baggy/_search-form.twig @@ -1,21 +1,7 @@ -<div id="search-form" class="messages info"> +<div id="search-form" class="messages info"> <form method="get" action="index.php"> - <input type="hidden" name="view" value="search"></input> + <input type="hidden" name="view" value="search"></input> <label><a href="javascript: void(null);" id="search-form-close">X</a>{% trans "Search" %}</label> : <input type="text" name="search" /> - <input id="submit-search" type="submit" value="{% trans "Search" %} !"></input> + <input id="submit-search" type="submit" value="{% trans "Search" %} !"></input> </form> -</div> -<script type="text/javascript"> - $(document).ready(function() { - - $("#search-form").hide(); - - $("#search").click(function(){ - $("#search-form").toggle(); - $("#search").toggleClass("current"); - $("#search-arrow").toggleClass("arrow-down"); - }); - - - }); -</script> \ No newline at end of file +</div> \ No newline at end of file diff --git a/themes/default/_head.twig b/themes/default/_head.twig index ffbfc22e8..8c939e307 100755 --- a/themes/default/_head.twig +++ b/themes/default/_head.twig @@ -11,3 +11,4 @@ <script src="{{ poche_url }}themes/default/js/autoClose.js"></script> <script src="{{ poche_url }}themes/default/js/closeMessage.js"></script> <script src="{{ poche_url }}themes/default/js/saveLink.js"></script> + <script src="{{ poche_url }}themes/default/js/popupForm.js"></script> \ No newline at end of file diff --git a/themes/default/js/popupForm.js b/themes/default/js/popupForm.js new file mode 100644 index 000000000..06be3f0cd --- /dev/null +++ b/themes/default/js/popupForm.js @@ -0,0 +1,20 @@ +$(document).ready(function() { + + $("#search-form").hide(); + + function closeSearch() { + $("#search-form").toggle(); + $("#search").toggleClass("current"); + $("#search-arrow").toggleClass("arrow-down"); + } + + $("#search").click(function(){ + closeSearch(); + }); + + $("#search-form-close").click(function(){ + closeSearch(); + }); + + +}); \ No newline at end of file