mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
Fixes blank hover state for Structure field, closes #1891
This commit is contained in:
@@ -207,6 +207,7 @@ en:
|
||||
check:
|
||||
yes: Yes
|
||||
no: No
|
||||
none: None
|
||||
background:
|
||||
title: Background
|
||||
description: Background settings
|
||||
|
||||
3
dist/locales/en.json
vendored
3
dist/locales/en.json
vendored
@@ -254,7 +254,8 @@
|
||||
"check": {
|
||||
"yes": "Yes",
|
||||
"no": "No"
|
||||
}
|
||||
},
|
||||
"none": "None"
|
||||
},
|
||||
"background": {
|
||||
"title": "Background",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
iD.ui.preset.radio = function(field) {
|
||||
|
||||
var event = d3.dispatch('change'),
|
||||
labels, radios;
|
||||
labels, radios, placeholder;
|
||||
|
||||
function radio(selection) {
|
||||
selection.classed('preset-radio', true);
|
||||
@@ -12,9 +12,8 @@ iD.ui.preset.radio = function(field) {
|
||||
var buttonWrap = wrap.enter().append('div')
|
||||
.attr('class', 'preset-input-wrap toggle-list');
|
||||
|
||||
buttonWrap.append('span')
|
||||
.attr('class', 'placeholder')
|
||||
.text(field.placeholder());
|
||||
placeholder = buttonWrap.append('span')
|
||||
.attr('class', 'placeholder');
|
||||
|
||||
labels = wrap.selectAll('label')
|
||||
.data(field.options || field.keys);
|
||||
@@ -59,6 +58,12 @@ iD.ui.preset.radio = function(field) {
|
||||
|
||||
labels.classed('active', checked);
|
||||
radios.property('checked', checked);
|
||||
var selection = radios.filter(function() { return this.checked; });
|
||||
if (selection.empty()) {
|
||||
placeholder.text(t('inspector.none'));
|
||||
} else {
|
||||
placeholder.text(selection.attr('value'));
|
||||
}
|
||||
};
|
||||
|
||||
radio.focus = function() {
|
||||
|
||||
Reference in New Issue
Block a user