mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-26 23:07:59 +01:00
Compensating for dynamic player height
This commit is contained in:
parent
3901313ed5
commit
b527f9c600
2 changed files with 9 additions and 3 deletions
|
@ -52,8 +52,7 @@ module.exports = angular.module('ponyfm').controller "application", [
|
||||||
|
|
||||||
$rootScope.$on 'player-starting-track', () ->
|
$rootScope.$on 'player-starting-track', () ->
|
||||||
$scope.isPlaying = true
|
$scope.isPlaying = true
|
||||||
windowHeight = $(window).height()
|
window.isPlaying = true
|
||||||
$('.site-body').height windowHeight - ($('.top-bar').height() + $('.now-playing').height())
|
|
||||||
|
|
||||||
$rootScope.$on 'player-stopping', () ->
|
$rootScope.$on 'player-stopping', () ->
|
||||||
$scope.isPlaying = false
|
$scope.isPlaying = false
|
||||||
|
|
|
@ -14,12 +14,17 @@
|
||||||
# You should have received a copy of the GNU Affero General Public License
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
window.isPlaying = false
|
||||||
|
|
||||||
window.handleResize = () ->
|
window.handleResize = () ->
|
||||||
windowHeight = $(window).height()
|
windowHeight = $(window).height()
|
||||||
windowWidth = $(window).width()
|
windowWidth = $(window).width()
|
||||||
isMobile = windowWidth <= 480
|
isMobile = windowWidth <= 480
|
||||||
$siteBody = $ '.site-body'
|
$siteBody = $ '.site-body'
|
||||||
|
|
||||||
|
if window.isPlaying
|
||||||
|
$siteBody.height windowHeight - ($('.top-bar').height() + $('.now-playing').height())
|
||||||
|
else
|
||||||
$siteBody.height windowHeight - $('.top-bar').height()
|
$siteBody.height windowHeight - $('.top-bar').height()
|
||||||
|
|
||||||
$('.dropdown-menu').each () ->
|
$('.dropdown-menu').each () ->
|
||||||
|
@ -32,6 +37,8 @@ window.handleResize = () ->
|
||||||
if !isMobile
|
if !isMobile
|
||||||
$this = $ this
|
$this = $ this
|
||||||
newHeight = windowHeight - $this.offset().top
|
newHeight = windowHeight - $this.offset().top
|
||||||
|
if window.isPlaying
|
||||||
|
newHeight = newHeight - $('.now-playing').height()
|
||||||
if newHeight > 0
|
if newHeight > 0
|
||||||
$this.height newHeight
|
$this.height newHeight
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue