Open goozzik opened 11 years ago
You would need to bind to region events (probably adding a new one) that tracks all regions and when they push to the history.
Then you would need cmd+z (etc.) to be handled by the thing that you've added, and not the region.. then you could track what region was last changed, and tell the region to undo it's history. You probably also want to scroll to that region that will be changing so people can see that it's changing.
Jeremy Jackson
On Sep 24, 2013, at 5:04 AM, Jakub notifications@github.com wrote:
I want to add global undo feature in project so it can undo action no matter which region is currently focused.
new Mercury.Region($('#header', $('iframe').contents()), window).history e {maxLength: 200, index: 0…}
Mercury.region.history e {maxLength: 200, index: 2....}
My question: How can I get region which is not currently focused with its history buffery
— Reply to this email directly or view it on GitHub.
Thanks for answer. Now I have history track of changed regions. One last question, how can I change behaviour of buttons undo and redo? In wiki I found this
Mercury.dialogHandlers contains the methods for when selects, palettes, and panels are loaded. Mercury.modalHandlers contains the methods for when modal windows are loaded (the one's that come down from the top and are centered). Mercury.lightviewHandlers contains the methods for lightviews (the ones that are black and in the center of the window -- the about dialog for instance)
How can I change these behaviours?
I want to add global undo feature in project so it can undo action no matter which region is currently focused.
new Mercury.Region($('#header', $('iframe').contents()), window).history
e {maxLength: 200, index: 0…}
Mercury.region.history
e {maxLength: 200, index: 2....}
My question: How can I get region which is not currently focused with its history buffery?