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

possible to have some kind of callback? #5

Open
vesper8 opened this issue Sep 30, 2020 · 1 comment
Open

possible to have some kind of callback? #5

vesper8 opened this issue Sep 30, 2020 · 1 comment

Comments

@vesper8
Copy link

vesper8 commented Sep 30, 2020

I'd like to trigger an event whenever the inline boolean is toggled.. is it possible to add some kind of callback so I can execute a closure whenever the boolean is toggled?

@vesper8 vesper8 changed the title possibly to have some kind of callback? possible to have some kind of callback? Sep 30, 2020
@yapsr
Copy link

yapsr commented Jan 30, 2023

@markrassamni @timmfroehlich @vesper8

Would it be possible to add a simple event dispatcher like below to resources/js/compontents/mixins/inline.js?

 return Nova.request().post(`/nova-api/${this.resourceName}/${this.resourceId}`, formData)
                .then(() => {
                    let message = this.value ? this.field.enableMessage : this.field.disableMessage;
                    this.$toasted.show(message, {type: 'success'});
                    Nova.$emit('inlineboolean-toggled', this);
                }, (response) => {
                    this.$toasted.show(response, { type: 'error' });
                })

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