]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Resources/views/themes/baggy/public/js/popupForm.js
Handle filter form using some JS
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Resources / views / themes / baggy / public / js / popupForm.js
index d233e600f3d837d0bac1bf7c2bae5aa1c7bbcd3c..b933acd1103005375dc1ab62340bc04a4d740641 100644 (file)
@@ -2,6 +2,7 @@ $(document).ready(function() {
 
     $("#search-form").hide();
     $("#bagit-form").hide();
+    $("#filter-form").hide();
 
     //---------------------------------------------------------------------------
     // Toggle the "Search" popup in the sidebar
@@ -18,6 +19,13 @@ $(document).ready(function() {
         }
     }
 
+    //---------------------------------------------------------------------------
+    // Toggle the "Filter" popup on entries list
+    //---------------------------------------------------------------------------
+    function toggleFilter() {
+        $("#filter-form").toggle();
+    }
+
     //---------------------------------------------------------------------------
     // Toggle the "Save a Link" popup in the sidebar
     //---------------------------------------------------------------------------
@@ -50,6 +58,11 @@ $(document).ready(function() {
         $("#searchfield").focus();
     });
 
+    $("#filter").click(function(){
+        closePopups();
+        toggleFilter();
+    });
+
     $("#bagit").click(function(){
         closePopups();
         toggleBagit();
@@ -60,13 +73,11 @@ $(document).ready(function() {
         toggleSearch();
     });
 
+    $("#filter-form-close").click(function(){
+        toggleFilter();
+    });
+
     $("#bagit-form-close").click(function(){
         toggleBagit();
     });
-
-    // $("#").click(function(){
-    //     toggleSearch();
-    // });
-
-
 });