Let preset editor preserve field state

The turn restrictions field wants to have selected state.
This commit is contained in:
John Firebaugh
2014-05-15 17:29:57 -07:00
parent 0afb5002cf
commit 15fb547bcc
2 changed files with 6 additions and 3 deletions
+4 -3
View File
@@ -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
+2
View File
@@ -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;