]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Merge pull request #920 from jsit/uifixes
authorNicolas Lœuillet <nicolas@loeuillet.org>
Mon, 3 Nov 2014 21:48:07 +0000 (22:48 +0100)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Mon, 3 Nov 2014 21:48:07 +0000 (22:48 +0100)
Many small UI changes/fixes to Baggy theme and English translation files

themes/baggy/css/main.css
themes/baggy/js/init.js
themes/default/js/popupForm.js
themes/default/js/saveLink.js

index f77021aab8b2115c454192e0defe20fd34b235ac..028c8b4eeaa76c0c82b906c3937b7644dd7396c0 100755 (executable)
@@ -1002,6 +1002,9 @@ pre code {
     height: auto;
     padding-top: 3em;
   }
+  #links.menu--open {
+    display: block;
+  }
   footer  {
     position: static;
     margin-right: 3em;
index 542f1d43ab70d6691f3091bb2af5cb3b0f65ce5f..74cbae683bbc3e9a9643d865087db721315eec3a 100755 (executable)
@@ -8,7 +8,7 @@ $.fn.ready(function() {
      ========================================================================== */
 
   $("#menu").click(function(){
-    $("#links").toggle();
+    $("#links").toggleClass('menu--open');
     if ($('#content').hasClass('opacity03')) {
         $('#content').removeClass('opacity03');
     }
index eb6d1ae203657e17d94c6519a22c8c324ef8463c..d233e600f3d837d0bac1bf7c2bae5aa1c7bbcd3c 100644 (file)
@@ -1,29 +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");
+        }
     }
 
-    $("#search").click(function(){
-        closeSearch();
-        // if other popup is already shown
-        if ($("#bagit-form").length != 0) {
-            $("#bagit").removeClass("active-current");
-            $('#content').removeClass("opacity03");
-            $("#bagit").removeClass("current");
-            $("#bagit-arrow").removeClass("arrow-down");
-            $("#bagit-form").hide();
+    //---------------------------------------------------------------------------
+    // 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");
         }
-        $('#searchfield').focus();
+    }
+
+    //---------------------------------------------------------------------------
+    // 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(){
-        closeSearch();
+        toggleSearch();
     });
 
+    $("#bagit-form-close").click(function(){
+        toggleBagit();
+    });
+
+    // $("#").click(function(){
+    //     toggleSearch();
+    // });
+
 
-});
\ No newline at end of file
+});
index b52b8a2c2bb0c35156cd66efe2c004f66417ff1e..a7acd84c3e808969cac189ca5cf57d267cdba8d6 100755 (executable)
@@ -36,18 +36,21 @@ $.fn.ready(function() {
     $('#plainurl').focus();
   }
 
-
-  $bagit.click(function(){
-    $bagit.toggleClass("current");
-    $("#bagit-arrow").toggleClass("arrow-down");
-    toggleSaveLinkForm();
-  });
-
-  $("#bagit-form-close").click(function(){
-    $bagit.removeClass("current");
-    $("#bagit-arrow").removeClass("arrow-down");
-    toggleSaveLinkForm();
-  });
+       //---------------------------------------------------------------------------
+       // These two functions are now taken care of in popupForm.js
+       //---------------------------------------------------------------------------
+
+  // $bagit.click(function(){
+  //   $bagit.toggleClass("current");
+  //   $("#bagit-arrow").toggleClass("arrow-down");
+  //   toggleSaveLinkForm();
+  // });
+
+  // $("#bagit-form-close").click(function(){
+  //   $bagit.removeClass("current");
+  //   $("#bagit-arrow").removeClass("arrow-down");
+  //   toggleSaveLinkForm();
+  // });
 
 
   //send "bag it link" form request via ajax