mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
@@ -1906,6 +1906,7 @@ div.combobox {
|
||||
margin-left: -30px;
|
||||
vertical-align: top;
|
||||
cursor: pointer;
|
||||
pointer-events: none;
|
||||
}
|
||||
[dir='rtl'] .combobox-caret {
|
||||
margin-left: 0;
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user