diff --git a/assets/controllers/materialize/form_select_controller.js b/assets/controllers/materialize/form_select_controller.js new file mode 100644 index 000000000..3a0fcf374 --- /dev/null +++ b/assets/controllers/materialize/form_select_controller.js @@ -0,0 +1,12 @@ +import { Controller } from '@hotwired/stimulus'; +import M from '@materializecss/materialize'; + +export default class extends Controller { + connect() { + this.instance = M.FormSelect.init(this.element.querySelector('select')); + } + + disconnect() { + this.instance.destroy(); + } +} diff --git a/assets/index.js b/assets/index.js index e4c9336b3..69fad640d 100755 --- a/assets/index.js +++ b/assets/index.js @@ -272,8 +272,6 @@ const articleScroll = () => { }; $(document).ready(() => { - $('select').formSelect(); - $('.fixed-action-btn').floatingActionButton(); stickyNav(); diff --git a/templates/Config/index.html.twig b/templates/Config/index.html.twig index 585725a19..d513904ac 100644 --- a/templates/Config/index.html.twig +++ b/templates/Config/index.html.twig @@ -71,7 +71,7 @@