mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Make sure the addablePresetIDs can be reset back to null too
This commit is contained in:
@@ -328,6 +328,8 @@ export function presetIndex(context) {
|
||||
_addablePresetIDs = val;
|
||||
if (_addablePresetIDs) { // reset all presets
|
||||
_this.collection.forEach(p => p.addable(_addablePresetIDs.has(p.id)));
|
||||
} else {
|
||||
_this.collection.forEach(p => p.addable(true));
|
||||
}
|
||||
|
||||
return _this;
|
||||
|
||||
@@ -192,6 +192,10 @@ describe('iD.presetIndex', function () {
|
||||
expect(presets.item('point').addable()).to.be.true;
|
||||
expect(presets.item('line').addable()).to.be.false;
|
||||
expect(presets.addablePresetIDs()).to.eql(ids);
|
||||
|
||||
presets.addablePresetIDs(null);
|
||||
expect(presets.item('point').addable()).to.be.true;
|
||||
expect(presets.item('line').addable()).to.be.true;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user