From 96803882ec2a7677f9e92f1707636b589edca461 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Tue, 12 Mar 2013 22:46:55 -0700 Subject: Scoreboard dynamic map width. --- css/stats.css | 2 +- js/mapspecs.js | 9 ++------- pages/scores.php | 5 +---- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/css/stats.css b/css/stats.css index 28d190a..bfb9571 100644 --- a/css/stats.css +++ b/css/stats.css @@ -97,7 +97,7 @@ .scoreCol { min-height:500px; - min-width:277px; + min-width:325px; float:left; } .mapCol { diff --git a/js/mapspecs.js b/js/mapspecs.js index 688c9dc..dbb1c60 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -852,17 +852,12 @@ function mapAsHTML(map, targetWidth, mapEditor) { //console.log("MapObj", map); mapdata[map.ID] = map; + //Map bigger than target width? if (!targetWidth || (map.width * 35) <= targetWidth) { + //Use standard size. targetWidth = (map.width * 35); } - else - { - //Need to take into account padding of .grid_outer - var fakeGridDom = $('
'); - var gridOuterPadding = parseInt(fakeGridDom.css('padding-left')) + parseInt(fakeGridDom.css('padding-right')); - targetWidth -= gridOuterPadding; - } var scale = map.width / targetWidth; //alert(scale); diff --git a/pages/scores.php b/pages/scores.php index 3f252ec..fc86b4f 100644 --- a/pages/scores.php +++ b/pages/scores.php @@ -118,10 +118,7 @@ function displayMapScores(mapID) { scoresShowPage(pointerPage, mapID); - //Create a fake DOM element to determine the margin-left of the map, to get the target width - var fakeMapDom = $('
'); - var mapMargin = parseInt(fakeMapDom.css('margin-left')); - var targetWidth = $('.mapNavCon').width() - $('#scoreDisplay').width() - mapMargin; + targetWidth = parseInt($('.wrapper').css("width")) - parseInt($('.scoreCol').css("width")); displayMap(mapID, "mapDisplay", targetWidth); } -- cgit v1.2.3