]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[WebUI] Reset dropdown when clearing filters 5317/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Sat, 25 Jan 2025 15:06:29 +0000 (18:06 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Sat, 25 Jan 2025 15:06:29 +0000 (18:06 +0300)
Ensure the action dropdown resets to its default value when clearing filters in the history table.

interface/js/app/libft.js

index 7106516a2b8179c82c38e1a5e21637db45fb4fb4..ca2a1ebef2e17bd1dd5a0324ff4dca069ed5569e 100644 (file)
@@ -318,6 +318,13 @@ define(["jquery", "app/common", "footable"],
                         self.removeFilter("action");
                     }
                     self.filter();
+                },
+                draw: function () {
+                    // Ensure the dropdown reflects the default value when filters are cleared.
+                    this._super();
+                    const actionFilter = this.find("action");
+                    const isActionFilterApplied = actionFilter instanceof FooTable.Filter;
+                    if (this.$action && !isActionFilterApplied) this.$action.val(this.def);
                 }
             });
             /* eslint-enable consistent-this, no-underscore-dangle */