Skip to content

Commit 1846c8f

Browse files
committed
Fix destroy on Android can't call callback function
1 parent 9dc2a34 commit 1846c8f

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ Check [#Examples](#examples) for now
2929
Your issues and pull requests are most welcome..
3030

3131
### Changelog
32+
**v1.1.1**<br>Fix destroy on Android can't call callback function
33+
3234
**v1.1.0**<br>Allow to manage right or left side menus window stack, [related issue](https://github.com/viezel/NappDrawer/issues/188)
3335
```javascript
3436
windowStack.setTargetInDrawer(windowStack.LEFT_WINDOW);

WindowStack.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ function WindowStack() {
208208
this.destroy = function(drawer, closeCallBack) {
209209

210210
if (drawer) {
211-
closeCallBack && drawer.addEventListener('close', closeCallBack);
211+
if (closeCallBack) {
212+
IOS ? drawer.addEventListener('close', closeCallBack) : drawer.window.addEventListener('close', closeCallBack);
213+
}
212214
drawer.close();
213215
} else if (IOS) {
214216
closeCallBack && navigationWindow.addEventListener('close', closeCallBack);

0 commit comments

Comments
 (0)