mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-24 00:54:03 +02:00
Hook into undos in a different way
This way doesn't depend on details of keybindings and the undo button. Also, implement this in DrawArea mode.
This commit is contained in:
@@ -83,6 +83,13 @@ describe("iD.History", function () {
|
||||
expect(history.redoAnnotation()).to.equal("annotation");
|
||||
});
|
||||
|
||||
it("emits an undone event", function () {
|
||||
history.perform(action);
|
||||
history.on('undone', spy);
|
||||
history.undo();
|
||||
expect(spy).to.have.been.called;
|
||||
});
|
||||
|
||||
it("emits a change event", function () {
|
||||
history.perform(action);
|
||||
history.on('change', spy);
|
||||
@@ -92,6 +99,14 @@ describe("iD.History", function () {
|
||||
});
|
||||
|
||||
describe("#redo", function () {
|
||||
it("emits an redone event", function () {
|
||||
history.perform(action);
|
||||
history.undo();
|
||||
history.on('change', spy);
|
||||
history.redo();
|
||||
expect(spy).to.have.been.called;
|
||||
});
|
||||
|
||||
it("emits a change event", function () {
|
||||
history.perform(action);
|
||||
history.undo();
|
||||
|
||||
Reference in New Issue
Block a user