No double initialization for javascript powered elements.

This commit is contained in:
Patrick Jentsch 2019-08-02 15:15:02 +02:00
parent 1b166e83e6
commit f2f62c64eb
2 changed files with 5 additions and 5 deletions

View File

@ -32,8 +32,8 @@
<a href="{{ url_for('main.index') }}" class="brand-logo"><i class="material-icons">opacity</i>Opaque</a>
<a href="#" data-target="slide-out" class="sidenav-trigger"><i class="material-icons">menu</i></a>
<ul class="right hide-on-med-and-down">
<li><a id="nav-notifications" class="dropdown-trigger" href="#!" data-target="nav-notifications-dropdown"><i class="material-icons">notifications</i></a></li>
<li><a id="nav-account" class="dropdown-trigger" href="#!" data-target="nav-account-dropdown"><i class="material-icons">account_circle</i></a></li>
<li><a id="nav-notifications" class="dropdown-trigger no-autoinit" href="#!" data-target="nav-notifications-dropdown"><i class="material-icons">notifications</i></a></li>
<li><a id="nav-account" class="dropdown-trigger no-autoinit" href="#!" data-target="nav-account-dropdown"><i class="material-icons">account_circle</i></a></li>
</ul>
</div>
</nav>
@ -159,8 +159,8 @@
{"alignment": "right", "constrainWidth": false, "coverTrigger": false}
);
M.Dropdown.init(
document.getElementById("nav-settings"),
{"alignment": "right", "constrainWidth": false, "coverTrigger": false}
document.getElementById("new-job"),
{"coverTrigger": false}
);
{% for message in get_flashed_messages() %}
M.toast({html: '{{ message }}'})

View File

@ -63,7 +63,7 @@
</div>
</div>
<div class="col s12 m4">
<p><a class="dropdown-trigger waves-effect waves-light btn right" href="#" data-target="new-job-dropdown"><i class="material-icons left">add</i>New job</a></p>
<p><a id="new-job" class="dropdown-trigger waves-effect waves-light btn right no-autoinit" href="#" data-target="new-job-dropdown"><i class="material-icons left">add</i>New job</a></p>
</div>
</div>
</li>