Moved localized delete button to the label, closes #1892

This commit is contained in:
Aaron Lidman
2013-10-15 10:55:53 -04:00
parent 451253a453
commit 27c3e4ce5d
2 changed files with 22 additions and 19 deletions
+4 -1
View File
@@ -1516,11 +1516,14 @@ input[type=number] {
}
.form-field .localized-wrap .entry .localized-value {
padding-right: 10%;
border-top-width: 0;
border-radius: 0 0 4px 4px;
}
.form-field .localized-wrap .form-label button {
border-top-right-radius: 3px;
}
/* Preset form address */
.form-field .addr-housename {
+18 -18
View File
@@ -113,11 +113,28 @@ iD.ui.preset.localized = function(field, context) {
var wrap = d3.select(this);
var langcombo = d3.combobox().fetcher(fetcher);
wrap.append('label')
var label = wrap.append('label')
.attr('class','form-label')
.text(t('translate.localized_translation_label'))
.attr('for','localized-lang');
label.append('button')
.attr('class', 'minor remove')
.on('click', function(d){
d3.event.preventDefault();
var t = {};
t[key(d.lang)] = undefined;
event.change(t);
d3.select(this.parentNode.parentNode)
.style('top','0')
.style('max-height','240px')
.transition()
.style('opacity', '0')
.style('max-height','0px')
.remove();
})
.append('span').attr('class', 'icon delete');
wrap.append('input')
.attr('class', 'localized-lang')
.attr('type', 'text')
@@ -132,23 +149,6 @@ iD.ui.preset.localized = function(field, context) {
.attr('type', 'text')
.attr('placeholder', t('translate.localized_translation_name'))
.attr('class', 'localized-value');
wrap.append('button')
.attr('class', 'minor button-input-action remove')
.on('click', function(d) {
d3.event.preventDefault();
var t = {};
t[key(d.lang)] = undefined;
event.change(t);
d3.select(this.parentNode)
.style('top','0')
.style('max-height','240px')
.transition()
.style('opacity', '0')
.style('max-height','0px')
.remove();
})
.append('span').attr('class', 'icon delete');
});
innerWrap