Updated resizer to work on mobile

This commit is contained in:
Josef Citrine 2016-07-17 13:25:27 +01:00
parent b527f9c600
commit 1edc3e8992
2 changed files with 9 additions and 7 deletions

View file

@ -53,6 +53,7 @@ module.exports = angular.module('ponyfm').controller "application", [
$rootScope.$on 'player-starting-track', () ->
$scope.isPlaying = true
window.isPlaying = true
window.handleResize()
$rootScope.$on 'player-stopping', () ->
$scope.isPlaying = false

View file

@ -34,9 +34,10 @@ window.handleResize = () ->
'max-height': newMaxHeight
$('.stretch-to-bottom').each () ->
if !isMobile
$this = $ this
newHeight = windowHeight - $this.offset().top
if isMobile
newHeight = newHeight - 5
if window.isPlaying
newHeight = newHeight - $('.now-playing').height()
if newHeight > 0