Commit d718209b authored by Job van der Voort's avatar Job van der Voort

responsive sidebar on dashboard

parent 8b6dd9d4
responsive_resize = -> responsive_resize = ->
current_width = $(window).width() current_width = $(window).width()
if current_width < 985 if current_width < 985
$('.side').addClass("ui right wide sidebar") $('.responsive-side').addClass("ui right wide sidebar")
else else
$('.side').removeClass("ui right wide sidebar") $('.responsive-side').removeClass("ui right wide sidebar")
$ -> $ ->
# Depending on window size, set the sidebar offscreen.
responsive_resize() responsive_resize()
$('.ui.sidebar') $('.ui.sidebar')
...@@ -22,6 +23,7 @@ $ -> ...@@ -22,6 +23,7 @@ $ ->
container.sidebar "hide" if not container.is(e.target) and container.has(e.target).length is 0 container.sidebar "hide" if not container.is(e.target) and container.has(e.target).length is 0
return return
# On resize, check if sidebar should be offscreen.
$(window).resize -> $(window).resize ->
responsive_resize() responsive_resize()
return return
...@@ -7,12 +7,11 @@ ...@@ -7,12 +7,11 @@
} }
.sidebar-expand-button { .sidebar-expand-button {
background: #fff; background: #f9f9f9;
color: #555; color: #555;
padding: 10px 15px; padding: 9px 12px 6px 14px;
border: 1px solid #E1E1E1; border: 1px solid #E1E1E1;
border-right: 0; border-right: 0;
border-radius: 3px;
position: fixed; position: fixed;
top: 108px; top: 108px;
right: 0px; right: 0px;
...@@ -22,7 +21,6 @@ ...@@ -22,7 +21,6 @@
-moz-transition: all 0.4s; -moz-transition: all 0.4s;
-webkit-transition: all 0.4s; -webkit-transition: all 0.4s;
&:hover { &:hover {
background: #ddd; background: #ddd;
color: #333; color: #333;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.dashboard.row .dashboard.row
.activities.col-md-8 .activities.col-md-8
= render 'activities' = render 'activities'
.side.col-md-4 .side.col-md-4.responsive-side
= render 'sidebar' = render 'sidebar'
.sidebar-expand-button.hidden-lg.hidden-md .sidebar-expand-button.hidden-lg.hidden-md
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment