Skip to content

Commit

Permalink
[17] Move dropdown to initializer
Browse files Browse the repository at this point in the history
  • Loading branch information
bterone committed May 10, 2021
1 parent 81b96cb commit 1fb6d17
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 33 deletions.
2 changes: 1 addition & 1 deletion assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ import '../css/app.scss';
// import socket from "./socket"
//
import 'phoenix_html';
import './screens/Dashboard';
import './initializers/dropdown';
9 changes: 9 additions & 0 deletions assets/js/initializers/dropdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Dropdown } from '../vendor/bootstrap';

const SELECTOR = '[data-toggle="dropdown"]';

document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll(SELECTOR).forEach((element) => {
new Dropdown(element);
});
});
32 changes: 0 additions & 32 deletions assets/js/screens/Dashboard/index.js

This file was deleted.

0 comments on commit 1fb6d17

Please sign in to comment.