Skip to content
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

add Event handling for uk-switcher component #187

Closed
stefanhofmann2 opened this issue Aug 18, 2019 · 4 comments
Closed

add Event handling for uk-switcher component #187

stefanhofmann2 opened this issue Aug 18, 2019 · 4 comments

Comments

@stefanhofmann2
Copy link
Contributor

is it possible to add the following code to the item sub-component of uk-switcher:
setEvents() {
let events = {
beforeshow: this.getWithDefault("on-beforeshow", noop),
show: this.getWithDefault("on-show", noop),
shown: this.getWithDefault("on-shown", noop),
beforehide: this.getWithDefault("on-beforehide", noop),
hide: this.getWithDefault("on-hide", noop),
hidden: this.getWithDefault("on-hidden", noop)
};

for (let event in events) {
  UIkit.util.on(this.element, event, events[event]);
}

},
didInsertElement() {
this._super(...arguments);
this.setEvents();
}
to enable the event handling. Thanks

@anehx
Copy link
Member

anehx commented Aug 19, 2019

Hi @stefanhofmann2

Could you open a pull request with your suggested code?

@stefanhofmann2
Copy link
Contributor Author

done

@anehx
Copy link
Member

anehx commented Aug 20, 2019

Actually, this was not exactly what I meant. I left you some feedback on your PR on how to do it properly..

@stefanhofmann2
Copy link
Contributor Author

ok, is available in new release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants