Pony.fm/public/scripts/shared/layout.coffee

24 lines
746 B
CoffeeScript
Raw Normal View History

2013-07-25 23:33:04 +02:00
window.handleResize = () ->
windowHeight = $(window).height()
$siteBody = $ '.site-body'
$siteBody.height windowHeight - $('header').height() - 1
2013-07-28 19:45:21 +02:00
$('.stretch-to-bottom').each () ->
2013-07-25 23:33:04 +02:00
$this = $ this
$this.height windowHeight - $this.offset().top
2013-07-28 23:51:35 +02:00
backgroundOne = $ '.background-one'
backgroundTwo = $ '.background-two'
backgroundOne.css 'left', $('.site-content ').offset().left - backgroundOne.width()
backgroundTwo.css 'left', $('.site-content').offset().left + $('.site-content').width()
2013-07-27 02:15:07 +02:00
window.alignVertically = (element) ->
$element = $(element)
$parent = $element.parent()
$element.css 'top', $parent.height() / 2 - $element.height() / 2
2013-07-25 23:33:04 +02:00
window.handleResize()
$(window).resize window.handleResize
$('.site-content').empty()