forked from dbroqua/MusicTopus
{WIP} Bulma => Knacss (toastr & flash)
This commit is contained in:
parent
fe0a51e707
commit
2209b410f1
6 changed files with 110 additions and 52 deletions
|
@ -26,7 +26,7 @@
|
|||
|
||||
<script>
|
||||
function showToastr(message) {
|
||||
var x = document.getElementById("toastr");
|
||||
let x = document.getElementById("toastr");
|
||||
if ( message ) {
|
||||
x.getElementsByTagName("SPAN")[0].innerHTML = message;
|
||||
}
|
||||
|
@ -34,6 +34,12 @@
|
|||
x.className = `${x.className} show`;
|
||||
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
|
||||
};
|
||||
|
||||
function hideToastr() {
|
||||
let x = document.getElementById("toastr");
|
||||
|
||||
x.className = x.className.replace("show", "");
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
|
||||
|
@ -120,55 +126,40 @@
|
|||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- <div id="toastr" class="notification is-danger">
|
||||
<button class="delete"></button>
|
||||
<div id="toastr">
|
||||
<button class="delete" onclick="hideToastr()"></button>
|
||||
<span></span>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- <main class="layout-maxed">
|
||||
<% if ( page.failureFlash || (error && error.length > 0 ) ) {%>
|
||||
<div class="columns is-mobile">
|
||||
<div class="
|
||||
column
|
||||
is-10-mobile is-offset-1-mobile
|
||||
is-8-tablet is-offset-2-tablet
|
||||
is-6-desktop is-offset-3-desktop
|
||||
is-4-widescreen is-offset-4-widescreen
|
||||
">
|
||||
<% if ( page.failureFlash ) {%>
|
||||
<article class="message is-danger">
|
||||
<div class="message-header">
|
||||
<p>Erreur</p>
|
||||
</div>
|
||||
<div class="message-body">
|
||||
<%= page.failureFlash %>
|
||||
</div>
|
||||
</article>
|
||||
<% } %>
|
||||
<%
|
||||
if (error && error.length > 0) {
|
||||
for( let i = 0 ; i < error.length ; i += 1 ) {
|
||||
%>
|
||||
<article class="message is-danger">
|
||||
<div class="message-header">
|
||||
<p>Erreur</p>
|
||||
<button class="delete" aria-label="delete"></button>
|
||||
</div>
|
||||
<div class="message-body">
|
||||
<%= error %>
|
||||
</div>
|
||||
</article>
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
<% if ( page.failureFlash || (error && error.length > 0 ) ) {%>
|
||||
<div class="flash">
|
||||
<% if ( page.failureFlash ) {%>
|
||||
<div class="header">
|
||||
Erreur
|
||||
</div>
|
||||
<div class="body">
|
||||
<%= page.failureFlash %>
|
||||
</div>
|
||||
<% } %>
|
||||
<%
|
||||
if (error && error.length > 0) {
|
||||
for( let i = 0 ; i < error.length ; i += 1 ) {
|
||||
%>
|
||||
<div class="header">
|
||||
Erreur
|
||||
</div>
|
||||
<% } %>
|
||||
</main> -->
|
||||
<div class="body">
|
||||
<%= error %>
|
||||
</div>
|
||||
<%
|
||||
}
|
||||
}
|
||||
%>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
<%- include(viewname) %>
|
||||
|
||||
|
||||
<footer class="footer layout-hero">
|
||||
<p>
|
||||
<strong title="Merci Brunus ! 😜">My Music Library</strong> par <a href="https://www.darkou.fr">Damien Broqua</a>.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue