From 5a1dfeec7253149aef07eeacebf05c634cbdb01f Mon Sep 17 00:00:00 2001 From: Max Grossman Date: Thu, 20 Dec 2018 08:47:37 -0500 Subject: [PATCH 1/5] open combobox if anywhere on box clicked... ref #5596 --- css/80_app.css | 1 + modules/ui/combobox.js | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/css/80_app.css b/css/80_app.css index 296359eb2..0f6cc4411 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -1906,6 +1906,7 @@ div.combobox { margin-left: -30px; vertical-align: top; cursor: pointer; + pointer-events: none; } [dir='rtl'] .combobox-caret { margin-left: 0; diff --git a/modules/ui/combobox.js b/modules/ui/combobox.js index f8f6f8779..fa3cdbe7f 100644 --- a/modules/ui/combobox.js +++ b/modules/ui/combobox.js @@ -49,9 +49,9 @@ export function uiCombobox(context, klass) { .on('keydown.typeahead', keydown) .on('keyup.typeahead', keyup) .on('input.typeahead', change) + .on('mouseover', mouseover) .each(addCaret); - function addCaret() { var parent = this.parentNode; var sibling = this.nextSibling; @@ -65,22 +65,6 @@ export function uiCombobox(context, klass) { .attr('class', 'combobox-caret') .merge(caret); - caret - .on('mousedown', function () { - // prevent the form element from blurring. it blurs on mousedown - d3_event.stopPropagation(); - d3_event.preventDefault(); - var combo = container.selectAll('.combobox'); - if (combo.empty()) { - input.node().focus(); - fetch('', function() { - show(); - render(); - }); - } else { - hide(); - } - }); } @@ -205,6 +189,22 @@ export function uiCombobox(context, klass) { } + function mouseover() { + // prevent the form element from blurring. it blurs on mousedown + d3_event.stopPropagation(); + d3_event.preventDefault(); + var combo = container.selectAll('.combobox'); + if (combo.empty()) { + input.node().focus(); + fetch('', function() { + show(); + render(); + }); + } else { + hide(); + } + } + function nav(dir) { if (!_suggestions.length) return; From e3407d41680a7327fa50f9f4f5211997b4331664 Mon Sep 17 00:00:00 2001 From: Max Grossman Date: Thu, 20 Dec 2018 09:05:23 -0500 Subject: [PATCH 2/5] do not use mouseover, use mousedown! ref #5596 --- modules/ui/combobox.js | 4 ++-- test/spec/ui/combobox.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/ui/combobox.js b/modules/ui/combobox.js index fa3cdbe7f..6a2e0174a 100644 --- a/modules/ui/combobox.js +++ b/modules/ui/combobox.js @@ -49,7 +49,7 @@ export function uiCombobox(context, klass) { .on('keydown.typeahead', keydown) .on('keyup.typeahead', keyup) .on('input.typeahead', change) - .on('mouseover', mouseover) + .on('mousedown', mousedown) .each(addCaret); function addCaret() { @@ -189,7 +189,7 @@ export function uiCombobox(context, klass) { } - function mouseover() { + function mousedown() { // prevent the form element from blurring. it blurs on mousedown d3_event.stopPropagation(); d3_event.preventDefault(); diff --git a/test/spec/ui/combobox.js b/test/spec/ui/combobox.js index 48953282a..a48a62ac5 100644 --- a/test/spec/ui/combobox.js +++ b/test/spec/ui/combobox.js @@ -90,7 +90,7 @@ describe('uiCombobox', function() { it('adds combobox under container', function() { input.call(combobox.data(data)); - body.selectAll('.combobox-caret').dispatch('mousedown'); + body.selectAll('.combobox-input').dispatch('mousedown'); expect(d3.select('.id-container > div.combobox').nodes().length).to.equal(1); }); @@ -106,14 +106,14 @@ describe('uiCombobox', function() { it('shows all entries when clicking on the caret', function() { input.property('value', 'foobar').call(combobox.data(data)); - body.selectAll('.combobox-caret').dispatch('mousedown'); + body.selectAll('.combobox-input').dispatch('mousedown'); expect(body.selectAll('.combobox-option').size()).to.equal(5); expect(body.selectAll('.combobox-option').text()).to.equal('foobar'); }); it('is initially shown with no selection', function() { input.call(combobox.data(data)); - body.selectAll('.combobox-caret').dispatch('mousedown'); + body.selectAll('.combobox-input').dispatch('mousedown'); expect(body.selectAll('.combobox-option.selected').size()).to.equal(0); }); From 18c32511a2d22af2b2137c536a18022396ccd923 Mon Sep 17 00:00:00 2001 From: Max Grossman Date: Thu, 20 Dec 2018 09:23:58 -0500 Subject: [PATCH 3/5] remove member's highlight when removed from relation ref #5612 --- modules/ui/raw_member_editor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/ui/raw_member_editor.js b/modules/ui/raw_member_editor.js index 2689715c5..c6cf10248 100644 --- a/modules/ui/raw_member_editor.js +++ b/modules/ui/raw_member_editor.js @@ -81,6 +81,9 @@ export function uiRawMemberEditor(context) { if (!context.hasEntity(d.relation.id)) { context.enter(modeBrowse(context)); } + + utilHighlightEntity(d.id, false, context); + } From 9a5a77f96c8a1a4bd73c6335a99548c6e74b12aa Mon Sep 17 00:00:00 2001 From: Max Grossman Date: Thu, 20 Dec 2018 09:24:46 -0500 Subject: [PATCH 4/5] remove unneccessary space ref #5612 --- modules/ui/raw_member_editor.js | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/ui/raw_member_editor.js b/modules/ui/raw_member_editor.js index c6cf10248..a6b52f60c 100644 --- a/modules/ui/raw_member_editor.js +++ b/modules/ui/raw_member_editor.js @@ -83,7 +83,6 @@ export function uiRawMemberEditor(context) { } utilHighlightEntity(d.id, false, context); - } From 97c2361f431f960da979507fbd6c6dd022a932bb Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Thu, 20 Dec 2018 10:17:16 -0500 Subject: [PATCH 5/5] Changed initial sidebar screen for highway intersection vertices from preset list to editor --- modules/ui/inspector.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/ui/inspector.js b/modules/ui/inspector.js index e167ee41e..ccb415077 100644 --- a/modules/ui/inspector.js +++ b/modules/ui/inspector.js @@ -46,9 +46,10 @@ export function uiInspector(context) { var entity = context.entity(_entityID); - var isTaglessVertex = entity.geometry(context.graph()) === 'vertex' && !entity.hasNonGeometryTags(); - // start with the preset list if the feature is new or is a vertex with no tags - var showPresetList = newFeature || isTaglessVertex; + var isTaglessOrIntersectionVertex = entity.geometry(context.graph()) === 'vertex' && + (!entity.hasNonGeometryTags() && !entity.isHighwayIntersection(context.graph())); + // start with the preset list if the feature is new or is an uninteresting vertex + var showPresetList = newFeature || isTaglessOrIntersectionVertex; if (showPresetList) { wrap.style('right', '-100%');