diff --git a/js/interface.js b/js/interface.js index dc37596..340a7b2 100644 --- a/js/interface.js +++ b/js/interface.js @@ -59,11 +59,15 @@ class Settings { $('#skinURLSelect').select2({ templateResult: state => state.id - ? $(``) + ? $( + ``, + ) : state.text, templateSelection: state => state.id - ? $(``) + ? $( + ``, + ) : state.text, theme: 'bootstrap-5', width: '100%', @@ -72,6 +76,13 @@ class Settings { dropdownParent: $('#settingsModal'), placeholder: "URL de l'image", tags: true, + createTag: function (params) { + return { + id: $.fn.select2.defaults.defaults.escapeMarkup(params.term), + text: 'Ajouté manuellement', + newTag: true, + }; + }, }); if (localStorage['skinURL']) { if (