From 1edc3e899275f1add1f792e999af808962d40c77 Mon Sep 17 00:00:00 2001 From: Josef Citrine Date: Sun, 17 Jul 2016 13:25:27 +0100 Subject: [PATCH] Updated resizer to work on mobile --- .../scripts/app/controllers/application.coffee | 1 + resources/assets/scripts/shared/layout.coffee | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/resources/assets/scripts/app/controllers/application.coffee b/resources/assets/scripts/app/controllers/application.coffee index b8cfb67f..fcd01347 100644 --- a/resources/assets/scripts/app/controllers/application.coffee +++ b/resources/assets/scripts/app/controllers/application.coffee @@ -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 diff --git a/resources/assets/scripts/shared/layout.coffee b/resources/assets/scripts/shared/layout.coffee index 3f561f39..ed5e01f7 100644 --- a/resources/assets/scripts/shared/layout.coffee +++ b/resources/assets/scripts/shared/layout.coffee @@ -34,13 +34,14 @@ window.handleResize = () -> 'max-height': newMaxHeight $('.stretch-to-bottom').each () -> - if !isMobile - $this = $ this - newHeight = windowHeight - $this.offset().top - if window.isPlaying - newHeight = newHeight - $('.now-playing').height() - if newHeight > 0 - $this.height newHeight + $this = $ this + newHeight = windowHeight - $this.offset().top + if isMobile + newHeight = newHeight - 5 + if window.isPlaying + newHeight = newHeight - $('.now-playing').height() + if newHeight > 0 + $this.height newHeight $('.revealable').each () -> $this = $ this