Skip to content

Commit

Permalink
Fix layout errors when resizing window
Browse files Browse the repository at this point in the history
  • Loading branch information
yishn committed Sep 7, 2016
1 parent 1446d8f commit 53b08e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions view/index.view.js
Original file line number Diff line number Diff line change
Expand Up @@ -640,11 +640,11 @@ function prepareScrollbars() {
if (!$('#gamechooser').hasClass('show')) return

var width = $('#gamechooser .games-list').width() - 20
var $lis = $('#gamechooser ol li')
var $svgs = $('#gamechooser ol li svg')

if ($lis.length == 0) return
if ($svgs.length == 0) $svgs = $('#gamechooser ol li')

var liwidth = $lis.eq(0).width() + 12 + 20
var liwidth = $svgs.width() + 12 + 20
var count = Math.floor(width / liwidth)

$('#gamechooser ol li').css('width', Math.floor(width / count) - 20)
Expand Down Expand Up @@ -1638,7 +1638,7 @@ function showGameChooser(restoreScrollbarPos) {

var updateSVG = function() {
var listBounds = $('#gamechooser').get(0).getBoundingClientRect()

var updateElements = $('#gamechooser ol li').get().filter(function(el) {
var bounds = el.getBoundingClientRect()

Expand Down

0 comments on commit 53b08e7

Please sign in to comment.