Skip to content
This repository has been archived by the owner on May 12, 2019. It is now read-only.

Commit

Permalink
main overflow based in a class instead of css inline
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Aug 14, 2015
1 parent d2484ff commit ffa9893
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 7 additions & 11 deletions assets/js/src/cover.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,17 @@ $ ->
$('.cover').addClass 'animated'
, 1000)

_expand = (options = {})->
method = if options.toggle is 'hide' then 'addClass' else 'toggleClass'
$('.cover')[method] 'expanded'
$('.link-item')[method] 'expanded'
Uno.search.form options.form if options.form?
_expand = (options)->
$('main, .cover, .link-item').toggleClass 'expanded'
Uno.search.form options.form

$('#blog-button, #avatar-link').click ->
return $('#menu-button').trigger('click') unless Uno.is 'device', 'desktop'
_expand(hide: 'toggle', form: 'toggle')
return $('#menu-button').trigger 'click' unless Uno.is 'device', 'desktop'
_expand form: 'toggle'

$("#menu-button").click ->
$('.cover').toggleClass 'expanded'
$('.main').toggleClass 'expanded'
$('#menu-button').toggleClass 'expanded'
$('main, .cover, #menu-button').toggleClass 'expanded'

if (Uno.is 'device', 'desktop') and (Uno.is 'page', 'home')
_animate()
_expand(aside: 'hide', form: 'hide') if !isOpen
_expand form: 'hide' if !isOpen
4 changes: 4 additions & 0 deletions assets/scss/modules/_global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ main {
left: 22.5rem;
padding: 2rem 3rem;

&.expanded {
overflow: hidden
}

> .content {
padding: 2rem 0;
margin: 0 3.7rem;
Expand Down

0 comments on commit ffa9893

Please sign in to comment.