inline-boolean
inline-boolean copied to clipboard
possible to have some kind of callback?
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?
@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' });
})