diff --git a/app/assets/javascripts/mobile.js b/app/assets/javascripts/mobile.js index 538c35337..fc7da390a 100644 --- a/app/assets/javascripts/mobile.js +++ b/app/assets/javascripts/mobile.js @@ -37,11 +37,27 @@ $(document).ready(function(){ if (app.hasClass('draw')){ app.removeClass('draw'); - } - else { + } else { app.addClass('draw'); } }; + + /* Show / hide aspects in the drawer */ + $('#all_aspects').bind("tap click", function(evt){ + evt.preventDefault(); + toggleAspectsMenu(); + }); + + var toggleAspectsMenu = function(){ + var aspect_list = $("#all_aspects + li"); + + if (aspect_list.hasClass('hide')){ + aspect_list.removeClass('hide'); + } else { + aspect_list.addClass('hide'); + } + }; + /* Heart toggle */ $(".like_action", ".stream").bind("tap click", function(evt){ diff --git a/app/assets/stylesheets/mobile.css.scss b/app/assets/stylesheets/mobile.css.scss index 25e49d629..017e5a444 100644 --- a/app/assets/stylesheets/mobile.css.scss +++ b/app/assets/stylesheets/mobile.css.scss @@ -114,24 +114,28 @@ h3 { bottom: 0px; overflow: auto; width: 100%; - } - li { - font-size: 25px; - line-height: 25px; - font-weight: bold; - color: $light-grey; - padding: 12px 25px; - border-bottom: solid rgb(53, 53, 53) 2px; - } + li { + font-size: 25px; + line-height: 25px; + font-weight: bold; + color: $light-grey; + padding: 12px 25px; + border-bottom: solid rgb(53, 53, 53) 2px; + } - .no_border { - padding: 0px; - border-bottom: 0px; + .no_border { + padding: 0px; + border-bottom: 0px; + + > ul > li { + font-size: 14px; + padding: 8px 42px; + } + } - > ul > li { - font-size: 14px; - padding: 8px 42px; + .hide { + display: none; } } diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index 4b4ac86f5..386dbe676 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -97,17 +97,17 @@ = link_to t("streams.activity.title"), activity_stream_path %li = link_to t("streams.mentions.title"), mentioned_stream_path - %li - = t('streams.aspects.title') - %li.no_border + %li#all_aspects + = link_to t('streams.aspects.title'), "#" + %li.no_border.hide %ul - for aspect in current_user.aspects %li - = aspect.name + = link_to aspect.name, aspects_stream_path(a_ids: [aspect.id]) %li - = link_to(t('layouts.header.profile'), user_profile_path(current_user.username)) + = link_to t('layouts.header.profile'), user_profile_path(current_user.username) %li - = link_to(t('_contacts'), contacts_path) + = link_to t('_contacts'), contacts_path %li = link_to t('layouts.header.settings'), users_edit_path %li