mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-22 21:18:00 +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', () ->
|
||||
$scope.isPlaying = true
|
||||
windowHeight = $(window).height()
|
||||
$('.site-body').height windowHeight - ($('.top-bar').height() + $('.now-playing').height())
|
||||
window.isPlaying = true
|
||||
|
||||
$rootScope.$on 'player-stopping', () ->
|
||||
$scope.isPlaying = false
|
||||
|
|
|
@ -14,13 +14,18 @@
|
|||
# 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/>.
|
||||
|
||||
window.isPlaying = false
|
||||
|
||||
window.handleResize = () ->
|
||||
windowHeight = $(window).height()
|
||||
windowWidth = $(window).width()
|
||||
isMobile = windowWidth <= 480
|
||||
$siteBody = $ '.site-body'
|
||||
|
||||
$siteBody.height windowHeight - $('.top-bar').height()
|
||||
if window.isPlaying
|
||||
$siteBody.height windowHeight - ($('.top-bar').height() + $('.now-playing').height())
|
||||
else
|
||||
$siteBody.height windowHeight - $('.top-bar').height()
|
||||
|
||||
$('.dropdown-menu').each () ->
|
||||
$this = $ this
|
||||
|
@ -32,6 +37,8 @@ window.handleResize = () ->
|
|||
if !isMobile
|
||||
$this = $ this
|
||||
newHeight = windowHeight - $this.offset().top
|
||||
if window.isPlaying
|
||||
newHeight = newHeight - $('.now-playing').height()
|
||||
if newHeight > 0
|
||||
$this.height newHeight
|
||||
|
||||
|
|
Loading…
Reference in a new issue