]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/submit-on-change.js
Added more complexity in an attempt to make ldap host failover fit
[bookstack] / resources / js / components / submit-on-change.js
index 97996724235efda29fa1bc67752844da199cf644..aeacae23213bd96b94290ed9ab6a4e9e131a4b78 100644 (file)
@@ -6,7 +6,14 @@
 class SubmitOnChange {
 
     setup() {
-        this.$el.addEventListener('change', () => {
+        this.filter = this.$opts.filter;
+
+        this.$el.addEventListener('change', (event) => {
+
+            if (this.filter && !event.target.matches(this.filter)) {
+                return;
+            }
+
             const form = this.$el.closest('form');
             if (form) {
                 form.submit();