i'd like to get a callback when escape function is called. I'll provide my implementation bellow:
1) I'm using it as fowollows
<modal showing.bind="showing" escape-callback.call="escapeCallback()">
2) i changed modal.js so that it
accepts bindable escapeCallback
registers a keyboard handler when modal is shown ((attached and showing) or state changes to showing = true):
unregisters keyboard handler when modal is hidden or detached
My implementation is following (My source is in TypeScript instead of ES6 that is used in this project - but it is quite strait-forward to port it back to ES6):
i'd like to get a callback when escape function is called. I'll provide my implementation bellow:
1) I'm using it as fowollows
<modal showing.bind="showing" escape-callback.call="escapeCallback()">
2) i changed modal.js so that it
(attached and showing) or state changes to showing = true
):My implementation is following (My source is in TypeScript instead of ES6 that is used in this project - but it is quite strait-forward to port it back to ES6):