Open dulmandakh opened 8 years ago
Do you mean this is a bug and the following lines should bind to $.window
when you use DrawerLayout?
I would propose change something like below
$.on = function (event, callback, context) {
if (mod !== 'dk.napp.drawer' && (event === 'open' || event === 'close')) {
return $.window.addEventListener(translateEvent(event), callback);
}
return $.instance.addEventListener(translateEvent(event), callback);
};
$.off = function (event, callback, context) {
if (mod !== 'dk.napp.drawer' && (event === 'open' || event === 'close')) {
return $.window.addEventListener(translateEvent(event), callback);
}
return $.instance.removeEventListener(translateEvent(event), callback);
};
That looks like a good fix. Could you do a PR?
Currently, we cannot attach handlers to 'open' and 'close' events when using DrawerLayout because we're attaching handlers to $.instance instead of $.window