Skip to content

Commit

Permalink
improve navbar collapse for mobile views
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
  • Loading branch information
dzaporozhets committed Jun 1, 2015
1 parent a74dfa6 commit 01f6ae2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
4 changes: 4 additions & 0 deletions app/assets/javascripts/application.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ $ ->
$(@).next('table').show()
$(@).remove()

$('.navbar-toggle').on 'click', ->
$('.header-content .title').toggle()
$('.header-content .navbar-collapse').toggle()

# Show/hide comments on diff
$("body").on "click", ".js-toggle-diff-comments", (e) ->
$(@).toggleClass('active')
Expand Down
15 changes: 4 additions & 11 deletions app/assets/stylesheets/generic/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,12 @@ header {
}
}

.nav {
float: right;
margin-right: 0;
}

.navbar-toggle {
color: #666;
margin: 0;
border-radius: 0;
position: absolute;
right: 2px;

&:hover {
background-color: #EEE;
Expand Down Expand Up @@ -195,7 +192,8 @@ header {
}

.navbar-nav {
margin: 5px 0;
margin: 0px;
float: none !important;

.visible-xs, .visable-sm {
display: table-cell !important;
Expand All @@ -205,11 +203,6 @@ header {
li {
display: table-cell;
width: 1%;

a {
text-align: center;
font-size: 18px !important;
}
}
}
}
4 changes: 2 additions & 2 deletions app/views/layouts/header/_default.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
%h1.title
= title

%button.navbar-toggle{type: 'button', data: {target: '.navbar-collapse', toggle: 'collapse'}}
%button.navbar-toggle
%span.sr-only Toggle navigation
= icon('bars')

.navbar-collapse.collapse
%ul.nav.navbar-nav
%ul.nav.navbar-nav.pull-right
%li.hidden-sm.hidden-xs
= render 'layouts/search'
%li.visible-sm.visible-xs
Expand Down

0 comments on commit 01f6ae2

Please sign in to comment.