From 438bc93133a0f7203ae92e9031f6eb22dc9acf12 Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Tue, 22 May 2012 15:03:34 +0200 Subject: [PATCH] CC-3851 : Preview Player: does not expand on Chrome, too big on Firefox --- .../airtime/audiopreview/preview_jplayer.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/airtime_mvc/public/js/airtime/audiopreview/preview_jplayer.js b/airtime_mvc/public/js/airtime/audiopreview/preview_jplayer.js index 71f053a8f..caf5ab963 100644 --- a/airtime_mvc/public/js/airtime/audiopreview/preview_jplayer.js +++ b/airtime_mvc/public/js/airtime/audiopreview/preview_jplayer.js @@ -132,10 +132,18 @@ function buildplaylist(p_url, p_playIndex) { _playlist_jplayer.option("autoPlay", true); play(p_playIndex); - var height = Math.min(90 + (26 * total), 400); - window.innerWidth = 500; - window.innerHeight = height; - window.scrollbars = true; + var height = Math.min(143 + (26 * total), 400); + var width = 505; + + if (height === 400) { + window.scrollbars = true; + } + else { + //there's no scrollbars so we don't need the window to be as wide. + width = 490; + } + + window.resizeTo(width, height); }); } @@ -178,6 +186,5 @@ function playOne(p_audioFileID) { _playlist_jplayer._initPlaylist(playlist); _playlist_jplayer.play(0); - window.innerWidth = 490; - window.innerHeight = 120; + window.resizeTo(490, 167); } \ No newline at end of file