-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to register open/close listeners for side drawers(left | right). #821
Comments
WORKAROUND: A simple workaround which i am using now is to simply replace the original toggle icon with my own icon, which i have added my own click listener.
|
As mentioned in the chat support channel, open/close or expand/collapse have been standarized touse CollapseStrategy which already have the ability to register such listeners, there might be some component that might miss that so in that case if reported we will implement the feature in that standard way. for the layout drawers it was different since they dont use that and the animation is controlled with a css class attached/removed from the main layout, in general we added a new utility that is available for domino-ui components to listen to transition events. check the TransitionListeners.of(element)
.onTransitionStart(target -> {
DomGlobal.console.info("Transition started");
})
.onTransitionEnd(target -> {
DomGlobal.console.info("Transition Ends");
})
.onTransitionCancel(target -> {
DomGlobal.console.info("Transition Canceled");
}); or directly on a domino-ui component : element
.onTransitionStart(target -> {
DomGlobal.console.info("Transition started");
})
.onTransitionEnd(target -> {
DomGlobal.console.info("Transition Ends");
})
.onTransitionCancel(target -> {
DomGlobal.console.info("Transition Canceled");
}); The new API is now used to also add open/close listeners for the layout left/right drawers and the handlers can be registered like : layout.onLeftDrawerOpen((parent, drawer) -> {
DomGlobal.console.info(">>::::::::: LEFT Drawer open");
});
layout.onLeftDrawerClosed((parent, drawer) -> {
DomGlobal.console.info("<<::::::::: LEFT Drawer close");
});
layout.onRightDrawerOpen((parent, drawer) -> {
DomGlobal.console.info(">>::::::::: RIGHT Drawer open");
});
layout.onRightDrawerClosed((parent, drawer) -> {
DomGlobal.console.info("<<::::::::: RIGHT Drawer close");
}); |
I would like the ability to register listeners for the drawers. As mentioned on gitter im not sure when the open listener should fire, but i guess it should fire when the drawer is fully open after animations have completed. THe same would be true of the close listener.
The text was updated successfully, but these errors were encountered: