From 2f2376c8298ff96331119cea1a90cc38dd5d92ca Mon Sep 17 00:00:00 2001 From: dave Date: Thu, 28 Aug 2014 23:29:59 -0700 Subject: [PATCH] Player widths and don't update the player while dragging, this causes LAG --- static/css/style.css | 8 ++++---- static/js/app.js | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/static/css/style.css b/static/css/style.css index dcba5c2..2c55e2a 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -54,21 +54,21 @@ div.slider.slider-horizontal { float: left; } #playerdrop > div.controls { - min-width: 55px; - width: 20% + min-width: 45px; + width: 15% } #playerdrop > div.controls button { display: block; width: 100% } #playerdrop > div.timeshow { - width: 10%; + width: 20%; text-align: center; font-size: 18px; font-weight: 500; padding-top: 4px; } #playerdrop > div.time { - width: 70%; + width: 65%; padding: 6px 8px 5px 20px; } \ No newline at end of file diff --git a/static/js/app.js b/static/js/app.js index 345aefa..fe0ebc2 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -158,14 +158,15 @@ var behaviors = { $(this).addClass("dragging") }).on("slideStop", function(){ $(this).removeClass("dragging"); - }).on("slide", function(){ - paused = $("#player").data().jPlayer.status.paused newTime = $(".time-holder .player-slider").slider('getValue').val(); if(paused) { $("#player").jPlayer("pause", parseInt(newTime)) } else { $("#player").jPlayer("play", parseInt(newTime)) } + }).on("slide", function(){ + paused = $("#player").data().jPlayer.status.paused + newTime = $(".time-holder .player-slider").slider('getValue').val(); minutes = Math.floor(newTime/60) seconds = Math.floor(newTime-(minutes*60)) $(".timeshow").html(minutes+":"+(seconds<10?"0":"")+seconds)