mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-17 22:24:49 +02:00
Pass entity directly
This commit is contained in:
+1
-8
@@ -1,6 +1,5 @@
|
||||
iD.ui.preset = function(context) {
|
||||
iD.ui.preset = function(context, entity) {
|
||||
var event = d3.dispatch('change', 'setTags', 'close'),
|
||||
entity,
|
||||
tags,
|
||||
keys,
|
||||
preset,
|
||||
@@ -126,11 +125,5 @@ iD.ui.preset = function(context) {
|
||||
return presets;
|
||||
};
|
||||
|
||||
presets.entity = function(_) {
|
||||
if (!arguments.length) return entity;
|
||||
entity = _;
|
||||
return presets;
|
||||
};
|
||||
|
||||
return d3.rebind(presets, event, 'on');
|
||||
};
|
||||
|
||||
@@ -73,8 +73,7 @@ iD.ui.TagEditor = function(context, entity) {
|
||||
changeTags({ name: name.property('value') });
|
||||
});
|
||||
|
||||
presetUI = iD.ui.preset(context)
|
||||
.entity(entity)
|
||||
presetUI = iD.ui.preset(context, entity)
|
||||
.preset(preset)
|
||||
.on('change', changeTags)
|
||||
.on('close', event.close);
|
||||
|
||||
Reference in New Issue
Block a user