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', () -> $rootScope.$on 'player-starting-track', () ->
$scope.isPlaying = true $scope.isPlaying = true
window.isPlaying = true window.isPlaying = true
window.handleResize()
$rootScope.$on 'player-stopping', () -> $rootScope.$on 'player-stopping', () ->
$scope.isPlaying = false $scope.isPlaying = false

View file

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