From 8bbd82832493925f263d06840cc1b86271d416dd Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 25 Mar 2013 11:04:18 -0700 Subject: [PATCH] Simplify --- js/lib/d3.combobox.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/js/lib/d3.combobox.js b/js/lib/d3.combobox.js index 44686cdfd..2f79a0848 100644 --- a/js/lib/d3.combobox.js +++ b/js/lib/d3.combobox.js @@ -20,8 +20,10 @@ d3.combobox = function() { selection.append('div', input) .attr('class', 'combobox-carat') - .on('mousedown', stop) .on('mousedown', function() { + // prevent the form element from blurring. it blurs + // on mousedown + d3.event.stopPropagation(); d3.event.preventDefault(); mousedown(); }); @@ -35,13 +37,6 @@ d3.combobox = function() { }); } - function stop() { - // prevent the form element from blurring. it blurs - // on mousedown - d3.event.stopPropagation(); - d3.event.preventDefault(); - } - function blur() { // hide the combobox whenever the input element // loses focus