From b09bc8cfa2b51b9dfb753b16ec0252301d070bf0 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 1 Mar 2013 10:30:02 -0800 Subject: [PATCH] Extract selection reference --- js/id/modes/select.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/id/modes/select.js b/js/id/modes/select.js index c6630a2e7..a0c29dd59 100644 --- a/js/id/modes/select.js +++ b/js/id/modes/select.js @@ -87,9 +87,10 @@ iD.modes.Select = function(context, selection, initial) { }), true)); if (entity) { - context.container() - .select('.inspector-wrap') - .style('display', 'block') + var wrap = context.container() + .select('.inspector-wrap'); + + wrap.style('display', 'block') .style('opacity', 1) .datum(entity) .call(inspector); @@ -97,7 +98,7 @@ iD.modes.Select = function(context, selection, initial) { if (d3.event) { // Pan the map if the clicked feature intersects with the position // of the inspector - var inspectorSize = context.container().select('.inspector-wrap').size(), + var inspectorSize = wrap.size(), mapSize = context.map().size(), offset = 50, shiftLeft = d3.event.clientX - mapSize[0] + inspectorSize[0] + offset,