fix localized

This commit is contained in:
Tom MacWright
2016-09-05 21:40:41 -04:00
parent cb50b7b03a
commit 6189af9b47
3 changed files with 21 additions and 17 deletions
+9 -6
View File
@@ -21,11 +21,12 @@ export function localized(field, context) {
input = selection.selectAll('.localized-main')
.data([0]);
input.enter().append('input')
input = input.enter().append('input')
.attr('type', 'text')
.attr('id', 'preset-input-' + field.id)
.attr('class', 'localized-main')
.attr('placeholder', field.placeholder());
.attr('placeholder', field.placeholder())
.merge(input);
if (field.id === 'name') {
var preset = context.presets().match(entity, context.graph());
@@ -42,14 +43,15 @@ export function localized(field, context) {
var translateButton = selection.selectAll('.localized-add')
.data([0]);
translateButton.enter()
translateButton = translateButton.enter()
.append('button')
.attr('class', 'button-input-action localized-add minor')
.attr('tabindex', -1)
.call(Icon('#icon-plus'))
.call(tooltip()
.title(t('translate.translate'))
.placement('left'));
.placement('left'))
.merge(translateButton);
translateButton
.on('click', addNew);
@@ -57,8 +59,9 @@ export function localized(field, context) {
localizedInputs = selection.selectAll('.localized-wrap')
.data([0]);
localizedInputs.enter().append('div')
.attr('class', 'localized-wrap');
localizedInputs = localizedInputs.enter().append('div')
.attr('class', 'localized-wrap')
.merge(localizedInputs);
}
function addNew() {
+1
View File
@@ -18,3 +18,4 @@ export { functor } from './util';
export { SessionMutex } from './session_mutex';
export { SuggestNames } from './suggest_names';
export { triggerEvent } from './trigger_event';
export { getSetValue } from './get_set_value';