Reuse input variable

This commit is contained in:
John Firebaugh
2013-03-25 10:41:07 -07:00
parent 3fbc8905cb
commit a3d2411967
+5 -5
View File
@@ -14,9 +14,11 @@ d3.combobox = function() {
var typeahead = function(selection) {
var idx = -1;
input = selection.select('input').classed('combobox-input', true);
selection.append('div', selection.select('input'))
input = selection.select('input')
.classed('combobox-input', true);
selection.append('div', input)
.attr('class', 'combobox-carat')
.on('mousedown', stop)
.on('mousedown', function() {
@@ -25,9 +27,7 @@ d3.combobox = function() {
});
function updateSize() {
var rect = selection.select('input')
.node()
.getBoundingClientRect();
var rect = input.node().getBoundingClientRect();
container.style({
'left': rect.left + 'px',
'width': rect.width + 'px',