mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 07:25:15 +02:00
Remove accept behavior from preset forms
Doesn't really make sense with persistent sidebar.
This commit is contained in:
@@ -82,8 +82,7 @@ iD.ui.EntityEditor = function(context, entity) {
|
||||
.call(iD.ui.PresetIcon(context.geometry(entity.id)));
|
||||
|
||||
presetUI = iD.ui.preset(context, entity, preset)
|
||||
.on('change', changeTags)
|
||||
.on('close', browse);
|
||||
.on('change', changeTags);
|
||||
|
||||
var tageditorpreset = editorwrap.append('div')
|
||||
.attr('class', 'inspector-preset cf fillL col12')
|
||||
|
||||
+1
-2
@@ -1,6 +1,6 @@
|
||||
iD.ui.preset = function(context, entity, preset) {
|
||||
var original = context.graph().base().entities[entity.id],
|
||||
event = d3.dispatch('change', 'close'),
|
||||
event = d3.dispatch('change'),
|
||||
fields = [],
|
||||
tags = {},
|
||||
formwrap,
|
||||
@@ -10,7 +10,6 @@ iD.ui.preset = function(context, entity, preset) {
|
||||
field = _.clone(field);
|
||||
|
||||
field.input = iD.ui.preset[field.type](field, context)
|
||||
.on('close', event.close)
|
||||
.on('change', event.change);
|
||||
|
||||
field.reference = iD.ui.TagReference({key: field.key});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
iD.ui.preset.access = function(field, context) {
|
||||
var event = d3.dispatch('change', 'close'),
|
||||
var event = d3.dispatch('change'),
|
||||
entity,
|
||||
items;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
iD.ui.preset.address = function(field, context) {
|
||||
|
||||
var event = d3.dispatch('change', 'close'),
|
||||
var event = d3.dispatch('change'),
|
||||
housename,
|
||||
housenumber,
|
||||
street,
|
||||
@@ -36,9 +36,6 @@ iD.ui.preset.address = function(field, context) {
|
||||
}
|
||||
|
||||
function address(selection) {
|
||||
|
||||
function close() { return iD.behavior.accept().on('accept', event.close); }
|
||||
|
||||
var wrap = selection.append('div')
|
||||
.attr('class', 'preset-input-wrap');
|
||||
|
||||
@@ -48,16 +45,14 @@ iD.ui.preset.address = function(field, context) {
|
||||
.attr('class', 'addr-housename')
|
||||
.attr('id', 'preset-input-' + field.id)
|
||||
.on('blur', change)
|
||||
.on('change', change)
|
||||
.call(close());
|
||||
.on('change', change);
|
||||
|
||||
housenumber = wrap.append('input')
|
||||
.property('type', 'text')
|
||||
.attr('placeholder', field.t('placeholders.number'))
|
||||
.attr('class', 'addr-number')
|
||||
.on('blur', change)
|
||||
.on('change', change)
|
||||
.call(close());
|
||||
.on('change', change);
|
||||
|
||||
street = wrap.append('input')
|
||||
.property('type', 'text')
|
||||
@@ -72,16 +67,14 @@ iD.ui.preset.address = function(field, context) {
|
||||
.attr('placeholder', field.t('placeholders.city'))
|
||||
.attr('class', 'addr-city')
|
||||
.on('blur', change)
|
||||
.on('change', change)
|
||||
.call(close());
|
||||
.on('change', change);
|
||||
|
||||
postcode = wrap.append('input')
|
||||
.property('type', 'text')
|
||||
.attr('placeholder', field.t('placeholders.postcode'))
|
||||
.attr('class', 'addr-postcode')
|
||||
.on('blur', change)
|
||||
.on('change', change)
|
||||
.call(close());
|
||||
.on('change', change);
|
||||
}
|
||||
|
||||
function change() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
iD.ui.preset.check = function(field) {
|
||||
|
||||
var event = d3.dispatch('change', 'close'),
|
||||
var event = d3.dispatch('change'),
|
||||
values = ['', 'yes', 'no'],
|
||||
value = '',
|
||||
box,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
iD.ui.preset.combo = function(field) {
|
||||
|
||||
var event = d3.dispatch('change', 'close'),
|
||||
var event = d3.dispatch('change'),
|
||||
input;
|
||||
|
||||
function combo(selection) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
iD.ui.preset.defaultcheck = function(field) {
|
||||
|
||||
var event = d3.dispatch('change', 'close'),
|
||||
var event = d3.dispatch('change'),
|
||||
input;
|
||||
|
||||
var check = function(selection) {
|
||||
|
||||
@@ -4,7 +4,7 @@ iD.ui.preset.tel =
|
||||
iD.ui.preset.email =
|
||||
iD.ui.preset.url = function(field) {
|
||||
|
||||
var event = d3.dispatch('change', 'close'),
|
||||
var event = d3.dispatch('change'),
|
||||
input;
|
||||
|
||||
function i(selection) {
|
||||
@@ -13,8 +13,7 @@ iD.ui.preset.url = function(field) {
|
||||
.attr('id', 'preset-input-' + field.id)
|
||||
.attr('placeholder', field.placeholder || '')
|
||||
.on('blur', change)
|
||||
.on('change', change)
|
||||
.call(iD.behavior.accept().on('accept', event.close));
|
||||
.on('change', change);
|
||||
|
||||
function pm(elem, x) {
|
||||
var num = elem.value ?
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
iD.ui.preset.localized = function(field, context) {
|
||||
|
||||
var event = d3.dispatch('change', 'close'),
|
||||
var event = d3.dispatch('change'),
|
||||
wikipedia = iD.wikipedia(),
|
||||
input, localizedInputs, wikiTitles;
|
||||
|
||||
@@ -12,8 +12,7 @@ iD.ui.preset.localized = function(field, context) {
|
||||
.attr('class', 'localized-main')
|
||||
.attr('placeholder', field.placeholder || '')
|
||||
.on('blur', change)
|
||||
.on('change', change)
|
||||
.call(iD.behavior.accept().on('accept', event.close));
|
||||
.on('change', change);
|
||||
|
||||
var translateButton = selection.append('button')
|
||||
.attr('class', 'button-input-action localized-add minor')
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
iD.ui.preset.maxspeed = function(field, context) {
|
||||
|
||||
var event = d3.dispatch('change', 'close'),
|
||||
var event = d3.dispatch('change'),
|
||||
entity,
|
||||
imperial,
|
||||
unitInput,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
iD.ui.preset.radio = function(field) {
|
||||
|
||||
var event = d3.dispatch('change', 'close'),
|
||||
var event = d3.dispatch('change'),
|
||||
buttons;
|
||||
|
||||
function radio(selection) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
iD.ui.preset.textarea = function(field) {
|
||||
|
||||
var event = d3.dispatch('change', 'close'),
|
||||
var event = d3.dispatch('change'),
|
||||
input;
|
||||
|
||||
function i(selection) {
|
||||
@@ -9,8 +9,7 @@ iD.ui.preset.textarea = function(field) {
|
||||
.attr('placeholder', field.placeholder || '')
|
||||
.attr('maxlength', 255)
|
||||
.on('blur', change)
|
||||
.on('change', change)
|
||||
.call(iD.behavior.accept().on('accept', event.close));
|
||||
.on('change', change);
|
||||
}
|
||||
|
||||
function change() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
iD.ui.preset.wikipedia = function(field, context) {
|
||||
|
||||
var event = d3.dispatch('change', 'close'),
|
||||
var event = d3.dispatch('change'),
|
||||
wikipedia = iD.wikipedia(),
|
||||
language = iD.data.wikipedia[0],
|
||||
link, entity, lang, title;
|
||||
|
||||
Reference in New Issue
Block a user