From 5b5f3fe2e54db752c74ea2d2d7edcd7d64ec3c51 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 5 Mar 2013 15:30:21 -0800 Subject: [PATCH] Use consistent selection argument style --- js/id/renderer/background.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/js/id/renderer/background.js b/js/id/renderer/background.js index 53767e3da..014212033 100644 --- a/js/id/renderer/background.js +++ b/js/id/renderer/background.js @@ -46,9 +46,8 @@ iD.Background = function() { // derive the tiles onscreen, remove those offscreen and position tiles // correctly for the currentstate of `projection` - function background() { - var sel = this, - tiles = tile + function background(selection) { + var tiles = tile .scale(projection.scale()) .scaleExtent((source.data && source.data.scaleExtent) || [1, 17]) .translate(projection.translate())(), @@ -85,14 +84,15 @@ iD.Background = function() { d3.select(this) .on('load', null) .classed('tile-loaded', true); - background.apply(sel); + background(selection); } function error(d) { cache[d[3]] = false; - d3.select(this).on('load', null); - d3.select(this).remove(); - background.apply(sel); + d3.select(this) + .on('load', null) + .remove(); + background(selection); } function imageTransform(d) { @@ -104,7 +104,7 @@ iD.Background = function() { 'scale(' + scale + ',' + scale + ')'; } - var image = this + var image = selection .selectAll('img') .data(requests, function(d) { return d[3]; });