Skip to content

Commit

Permalink
Fix JSHint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
joelfillmore committed Dec 3, 2012
1 parent 61ee0be commit 1d64f1e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
8 changes: 3 additions & 5 deletions src/Grid.js
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
(function() { (function($) {


var Grid = Tiles.Grid = function(element) { var Grid = Tiles.Grid = function(element) {


Expand Down Expand Up @@ -171,10 +171,8 @@
prevTileIds.push(this.tiles[i].id); prevTileIds.push(this.tiles[i].id);
} }


var tileIds = prepend var tileIds = prepend ? newTileIds.concat(prevTileIds)
? newTileIds.concat(prevTileIds)
: prevTileIds.concat(newTileIds); : prevTileIds.concat(newTileIds);

this.updateTiles(tileIds); this.updateTiles(tileIds);
}; };


Expand Down Expand Up @@ -373,4 +371,4 @@
} }
}; };


})(); })(jQuery);
6 changes: 3 additions & 3 deletions src/Template.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
]; ];
*/ */


(function() { (function($) {


// remove whitespace and create 2d array // remove whitespace and create 2d array
var parseCells = function(rows) { var parseCells = function(rows) {
Expand Down Expand Up @@ -113,7 +113,7 @@
} }


// add the rect // add the rect
rects.push(new Rectangle(x, y, width, height)) rects.push(new Rectangle(x, y, width, height));
} }
} }


Expand Down Expand Up @@ -214,4 +214,4 @@
// period used to designate a single 1x1 cell tile // period used to designate a single 1x1 cell tile
Tiles.Template.SINGLE_CELL = '.'; Tiles.Template.SINGLE_CELL = '.';


})(); })(jQuery);
8 changes: 4 additions & 4 deletions src/Tile.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// single namespace export // single namespace export
var Tiles = {}; var Tiles = {};


(function() { (function($) {


var Tile = Tiles.Tile = function(tileId, element) { var Tile = Tiles.Tile = function(tileId, element) {


Expand Down Expand Up @@ -79,11 +79,11 @@ var Tiles = {};
var tile = this, var tile = this,
validateChangesAndComplete = function() { validateChangesAndComplete = function() {
var el = tile.$el[0]; var el = tile.$el[0];
if (tile.left != el.offsetLeft) { if (tile.left !== el.offsetLeft) {
//console.log ('mismatch left:' + tile.left + ' actual:' + el.offsetLeft + ' id:' + tile.id); //console.log ('mismatch left:' + tile.left + ' actual:' + el.offsetLeft + ' id:' + tile.id);
tile.$el.css('left', tile.left); tile.$el.css('left', tile.left);
} }
if (tile.top != el.offsetTop) { if (tile.top !== el.offsetTop) {
//console.log ('mismatch top:' + tile.top + ' actual:' + el.offsetTop + ' id:' + tile.id); //console.log ('mismatch top:' + tile.top + ' actual:' + el.offsetTop + ' id:' + tile.id);
tile.$el.css('top', tile.top); tile.$el.css('top', tile.top);
} }
Expand Down Expand Up @@ -113,4 +113,4 @@ var Tiles = {};
} }
}; };


})(); })(jQuery);
2 changes: 0 additions & 2 deletions src/UniformTemplates.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@ Tiles.UniformTemplates = {


return new Tiles.Template(rects, numCols, numRows); return new Tiles.Template(rects, numCols, numRows);
} }


}; };

0 comments on commit 1d64f1e

Please sign in to comment.