]>
BookStack Code Mirror - bookstack/blob - resources/js/components/submit-on-change.js
projects
/
bookstack
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge branch 'footer-links' of git://github.com/james-geiger/BookStack into james...
[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;