mirror of
https://github.com/wallabag/wallabag.git
synced 2025-06-27 16:36:00 +00:00
Extract Materialize Dropdown controller
This commit is contained in:
parent
a69ea46945
commit
1b683dbb05
3 changed files with 17 additions and 8 deletions
16
assets/controllers/materialize/dropdown_controller.js
Normal file
16
assets/controllers/materialize/dropdown_controller.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
import { Controller } from '@hotwired/stimulus';
|
||||
import M from '@materializecss/materialize';
|
||||
|
||||
export default class extends Controller {
|
||||
connect() {
|
||||
this.instance = M.Dropdown.init(this.element, {
|
||||
hover: false,
|
||||
coverTrigger: false,
|
||||
constrainWidth: false,
|
||||
});
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
this.instance.destroy();
|
||||
}
|
||||
}
|
|
@ -274,13 +274,6 @@ const articleScroll = () => {
|
|||
$(document).ready(() => {
|
||||
$('select').formSelect();
|
||||
|
||||
$('.dropdown-trigger').dropdown({ hover: false });
|
||||
$('.dropdown-trigger[data-covertrigger="false"][data-constrainwidth="false"]').dropdown({
|
||||
hover: false,
|
||||
coverTrigger: false,
|
||||
constrainWidth: false,
|
||||
});
|
||||
|
||||
$('.fixed-action-btn').floatingActionButton();
|
||||
|
||||
stickyNav();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue