diff --git a/media/commitfest/js/commitfest.js b/media/commitfest/js/commitfest.js index 77d49fc2..158e572c 100644 --- a/media/commitfest/js/commitfest.js +++ b/media/commitfest/js/commitfest.js @@ -379,4 +379,26 @@ $(document).ready(() => { return false; }); }); + + $(".enable-selectize").selectize({ + plugins: ["remove_button"], + valueField: "id", + labelField: "value", + searchField: "value", + onFocus: function () { + if (this.$input.is("[multiple]")) { + return; + } + this.lastValue = this.getValue(); + this.clear(false); + }, + onBlur: function () { + if (this.$input.is("[multiple]")) { + return; + } + if (this.getValue() === "") { + this.setValue(this.lastValue); + } + }, + }); }); diff --git a/pgcommitfest/commitfest/templates/base.html b/pgcommitfest/commitfest/templates/base.html index c70a7f77..9af10521 100644 --- a/pgcommitfest/commitfest/templates/base.html +++ b/pgcommitfest/commitfest/templates/base.html @@ -6,6 +6,8 @@ + + {%block extrahead%}{%endblock%} @@ -49,6 +51,7 @@