From 1c3d0dacee577b51421dbd7cc37293d9b1846b7a Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 23 May 2014 15:04:35 -0400 Subject: [PATCH] Replace all matches, not just the first one.. --- js/id/ui/preset/combo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/id/ui/preset/combo.js b/js/id/ui/preset/combo.js index c6f1e4e63..18f4a38af 100644 --- a/js/id/ui/preset/combo.js +++ b/js/id/ui/preset/combo.js @@ -32,7 +32,7 @@ iD.ui.preset.typeCombo = function(field) { function options(opts) { combobox.data(opts.map(function(d) { var o = {}; - o.title = o.value = d.replace('_', ' '); + o.title = o.value = d.replace(/_+/g, ' '); return o; })); @@ -44,7 +44,7 @@ iD.ui.preset.typeCombo = function(field) { } function change() { - var value = input.value().replace(' ', '_'); + var value = input.value().replace(/\s+/g, '_'); if (field.type === 'typeCombo' && !value) value = 'yes'; var t = {};