From e2bea810e383ea4c78d929c78785b8de4bf030ed Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Tue, 18 Jun 2013 17:58:04 -0400 Subject: [PATCH] Replace gnarly ternary expression with if statement --- src/drawer.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/drawer.js b/src/drawer.js index e0cba1d9..86c1db90 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -1112,11 +1112,13 @@ function drawTiles( drawer, lastDrawn ){ position = collectionTileSource.layout == 'horizontal' ? tile.y + ( tile.x * collectionTileSource.rows ) : - tile.x + ( tile.y * collectionTileSource.rows ), + tile.x + ( tile.y * collectionTileSource.rows ); - tileSource = position < collectionTileSource.tileSources.length ? - collectionTileSource.tileSources[ position ] : - null; + if (position < collectionTileSource.tileSources.length) { + tileSource = collectionTileSource.tileSources[ position ]; + } else { + tileSource = null; + } //$.console.log("Rendering collection tile %s | %s | %s", tile.y, tile.y, position); if( tileSource ){