Fix TagReference not updating

(closes #3521)
This commit is contained in:
Bryan Housel
2016-10-25 10:17:58 -04:00
parent 917e2e2a88
commit e4e2298ad6
2 changed files with 22 additions and 11 deletions

View File

@@ -34,9 +34,11 @@ export function uiEntityEditor(context) {
var entity = context.entity(id),
tags = _.clone(entity.tags);
// Header
var header = selection.selectAll('.header')
.data([0]);
// Enter
var enter = header.enter()
.append('div')
.attr('class', 'header fillL cf');
@@ -44,7 +46,6 @@ export function uiEntityEditor(context) {
enter
.append('button')
.attr('class', 'fl preset-reset preset-choose')
.on('click', function() { dispatch.call('choose', this, activePreset); })
.append('span')
.html((textDirection === 'rtl') ? '►' : '◄');
@@ -58,10 +59,19 @@ export function uiEntityEditor(context) {
.append('h3')
.text(t('inspector.edit'));
// Update
header = header
.merge(enter);
header.selectAll('.preset-reset')
.on('click', function() { dispatch.call('choose', this, activePreset); });
// Body
var body = selection.selectAll('.inspector-body')
.data([0]);
// Enter
enter = body.enter()
.append('div')
.attr('class', 'inspector-body');
@@ -73,10 +83,7 @@ export function uiEntityEditor(context) {
.attr('class', 'preset-list-button-wrap')
.append('button')
.attr('class', 'preset-list-button preset-reset')
.on('click', function() { dispatch.call('choose', this, activePreset); })
.call(tooltip()
.title(t('inspector.back_tooltip'))
.placement('bottom'))
.call(tooltip().title(t('inspector.back_tooltip')).placement('bottom'))
.append('div')
.attr('class', 'label');
@@ -96,7 +103,6 @@ export function uiEntityEditor(context) {
.append('div')
.attr('class', 'raw-membership-editor inspector-inner');
// Update
body = body
.merge(enter);
@@ -107,6 +113,9 @@ export function uiEntityEditor(context) {
body.selectAll('.preset-list-item')
.call(reference.body);
body.selectAll('.preset-reset')
.on('click', function() { dispatch.call('choose', this, activePreset); });
body.select('.preset-list-item button')
.call(uiPresetIcon()
.geometry(context.geometry(id))

View File

@@ -122,6 +122,12 @@ export function uiTagReference(tag) {
button = button.enter()
.append('button')
.attr('class', 'tag-reference-button')
.attr('tabindex', -1)
.call(svgIcon('#icon-inspect'))
.merge(button);
button
.on('click', function () {
d3.event.stopPropagation();
d3.event.preventDefault();
@@ -132,11 +138,7 @@ export function uiTagReference(tag) {
} else {
load(tag);
}
})
.attr('class', 'tag-reference-button')
.attr('tabindex', -1)
.call(svgIcon('#icon-inspect'))
.merge(button);
});
};