]> BookStack Code Mirror - bookstack/blob - resources/js/components/submit-on-change.js
Updated tinymce code block handling to help prevent breaking history states
[bookstack] / resources / js / components / submit-on-change.js
1 /**
2  * Submit on change
3  * Simply submits a parent form when this input is changed.
4  * @extends {Component}
5  */
6 class SubmitOnChange {
7
8     setup() {
9         this.$el.addEventListener('change', () => {
10             const form = this.$el.closest('form');
11             if (form) {
12                 form.submit();
13             }
14         });
15     }
16
17 }
18
19 export default SubmitOnChange;