From 725fbbf85e11bf00190f7b776b1e4d71963a19d9 Mon Sep 17 00:00:00 2001
From: flaburgan <flaburgan@geexxx.fr>
Date: Sat, 8 Feb 2014 21:34:54 +0100
Subject: [PATCH] Toggle with jquery + link on the whole line of the menu

---
 app/assets/javascripts/mobile.js          | 16 ++--------------
 app/assets/stylesheets/mobile.css.scss    |  5 +++--
 app/views/layouts/application.mobile.haml |  5 +++--
 3 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/app/assets/javascripts/mobile.js b/app/assets/javascripts/mobile.js
index fc7da390a3..fba7a6c10e 100644
--- a/app/assets/javascripts/mobile.js
+++ b/app/assets/javascripts/mobile.js
@@ -33,13 +33,7 @@ $(document).ready(function(){
   });
 
   var toggleDrawerMenu = function(){
-    var app = $("#app");
-
-    if (app.hasClass('draw')){
-      app.removeClass('draw');
-    } else {
-      app.addClass('draw');
-    }
+    $("#app").toggleClass('draw');
   };
   
   /* Show / hide aspects in the drawer */
@@ -49,13 +43,7 @@ $(document).ready(function(){
   });
 
   var toggleAspectsMenu = function(){
-    var aspect_list = $("#all_aspects + li");
-
-    if (aspect_list.hasClass('hide')){
-      aspect_list.removeClass('hide');
-    } else {
-      aspect_list.addClass('hide');
-    }
+    $("#all_aspects + li").toggleClass('hide');
   };
   
 
diff --git a/app/assets/stylesheets/mobile.css.scss b/app/assets/stylesheets/mobile.css.scss
index 7727cb8008..0a2741daf4 100644
--- a/app/assets/stylesheets/mobile.css.scss
+++ b/app/assets/stylesheets/mobile.css.scss
@@ -120,7 +120,6 @@ h3 {
       line-height: 25px;
       font-weight: bold;
       color: $light-grey;
-      padding: 12px 25px;
       border-bottom: solid rgb(53, 53, 53) 2px;
     }
 
@@ -128,7 +127,7 @@ h3 {
       padding: 0px;
       border-bottom: 0px;
       
-      > ul > li {
+      > ul > li > a {
         font-size: 14px;
         padding: 8px 42px;
       }
@@ -146,8 +145,10 @@ h3 {
   }
   
   a {
+    display: block;
     color: $light-grey;
     text-decoration: none;
+    padding: 12px 25px;
   }
 
   ul {
diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml
index 3c61c4f000..5bb0d4933e 100644
--- a/app/views/layouts/application.mobile.haml
+++ b/app/views/layouts/application.mobile.haml
@@ -102,8 +102,9 @@
                       %li
                         = link_to aspect.name, aspects_stream_path(a_ids: [aspect.id])
                 %li
-                  = link_to t('layouts.header.profile'), user_profile_path(current_user.username)
-                  = person_image_tag(current_user)
+                  = link_to user_profile_path(current_user.username) do
+                    = t('layouts.header.profile')
+                    = person_image_tag(current_user)
                 %li
                   = link_to t('_contacts'), contacts_path
                 %li
-- 
GitLab