mirror of
https://github.com/FoggedLens/iD.git
synced 2026-04-21 19:26:41 +02:00
Rename field function
This commit is contained in:
@@ -4,7 +4,7 @@ iD.ui.preset.localized = function(field, context) {
|
||||
input, localizedInputs, wikiTitles,
|
||||
entity;
|
||||
|
||||
function i(selection) {
|
||||
function localized(selection) {
|
||||
input = selection.selectAll('.localized-main')
|
||||
.data([0]);
|
||||
|
||||
@@ -203,7 +203,7 @@ iD.ui.preset.localized = function(field, context) {
|
||||
.value(function(d) { return d.value; });
|
||||
}
|
||||
|
||||
i.tags = function(tags) {
|
||||
localized.tags = function(tags) {
|
||||
// Fetch translations from wikipedia
|
||||
if (tags.wikipedia && !wikiTitles) {
|
||||
wikiTitles = {};
|
||||
@@ -228,13 +228,15 @@ iD.ui.preset.localized = function(field, context) {
|
||||
localizedInputs.call(render, postfixed.reverse());
|
||||
};
|
||||
|
||||
i.focus = function() {
|
||||
localized.focus = function() {
|
||||
input.node().focus();
|
||||
};
|
||||
|
||||
i.entity = function(_) {
|
||||
localized.entity = function(_) {
|
||||
if (!arguments.length) return entity;
|
||||
entity = _;
|
||||
return localized;
|
||||
};
|
||||
|
||||
return d3.rebind(i, dispatch, 'on');
|
||||
return d3.rebind(localized, dispatch, 'on');
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@ iD.ui.preset.textarea = function(field) {
|
||||
var dispatch = d3.dispatch('change'),
|
||||
input;
|
||||
|
||||
function i(selection) {
|
||||
function textarea(selection) {
|
||||
input = selection.selectAll('textarea')
|
||||
.data([0]);
|
||||
|
||||
@@ -25,13 +25,13 @@ iD.ui.preset.textarea = function(field) {
|
||||
};
|
||||
}
|
||||
|
||||
i.tags = function(tags) {
|
||||
textarea.tags = function(tags) {
|
||||
input.value(tags[field.key] || '');
|
||||
};
|
||||
|
||||
i.focus = function() {
|
||||
textarea.focus = function() {
|
||||
input.node().focus();
|
||||
};
|
||||
|
||||
return d3.rebind(i, dispatch, 'on');
|
||||
return d3.rebind(textarea, dispatch, 'on');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user