mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 22:03:37 +02:00
Let preset editor preserve field state
The turn restrictions field wants to have selected state.
This commit is contained in:
@@ -5,6 +5,8 @@ iD.ui.EntityEditor = function(context) {
|
||||
preset,
|
||||
reference;
|
||||
|
||||
var presetEditor = iD.ui.preset(context)
|
||||
.on('change', changeTags);
|
||||
var rawTagEditor = iD.ui.RawTagEditor(context)
|
||||
.on('change', changeTags);
|
||||
|
||||
@@ -91,12 +93,11 @@ iD.ui.EntityEditor = function(context) {
|
||||
.text(preset.name());
|
||||
|
||||
$body.select('.inspector-preset')
|
||||
.call(iD.ui.preset(context)
|
||||
.call(presetEditor
|
||||
.preset(preset)
|
||||
.entityID(id)
|
||||
.tags(tags)
|
||||
.state(state)
|
||||
.on('change', changeTags));
|
||||
.state(state));
|
||||
|
||||
$body.select('.raw-tag-editor')
|
||||
.call(rawTagEditor
|
||||
|
||||
@@ -200,6 +200,7 @@ iD.ui.preset = function(context) {
|
||||
|
||||
presets.preset = function(_) {
|
||||
if (!arguments.length) return preset;
|
||||
if (preset && preset.id === _.id) return presets;
|
||||
preset = _;
|
||||
fields = null;
|
||||
return presets;
|
||||
@@ -220,6 +221,7 @@ iD.ui.preset = function(context) {
|
||||
|
||||
presets.entityID = function(_) {
|
||||
if (!arguments.length) return id;
|
||||
if (id === _) return presets;
|
||||
id = _;
|
||||
fields = null;
|
||||
return presets;
|
||||
|
||||
Reference in New Issue
Block a user