mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Allow different flash level simultaneously
This commit is contained in:
parent
f93d116035
commit
5fffdda9a6
2 changed files with 5 additions and 7 deletions
|
@ -19,7 +19,7 @@
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
<div id="flash" class="alert" style="display: none">
|
<div id="flash" style="display: none">
|
||||||
</div>
|
</div>
|
||||||
<div id="slider-container">
|
<div id="slider-container">
|
||||||
<div id="slideBack" class="block" style="display: none;"></div>
|
<div id="slideBack" class="block" style="display: none;"></div>
|
||||||
|
|
10
js/app.js
10
js/app.js
|
@ -47,14 +47,12 @@ app = Sammy('#main', function (sam) {
|
||||||
html = '';
|
html = '';
|
||||||
for(lvl in flashs) {
|
for(lvl in flashs) {
|
||||||
flashs[lvl].forEach( function(msg) {
|
flashs[lvl].forEach( function(msg) {
|
||||||
html += '<div class="'+ lvl +'">'+ msg +'</div>';
|
if (lvl == 'fail') { alertClass = 'alert-danger'; }
|
||||||
|
else { alertClass = 'alert-'+ lvl; }
|
||||||
|
html += '<div class="alert '+ alertClass +'">'+ msg +'</div>';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (level == 'fail') { alertClass = 'alert-danger'; }
|
$('#flash').html(html).fadeIn();
|
||||||
else if (level == 'success') { alertClass = 'alert-success'; }
|
|
||||||
else { alertClass = 'alert-info'; }
|
|
||||||
|
|
||||||
$('#flash').removeClass().addClass('alert '+ alertClass).html(html).fadeIn();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// API connection helper
|
// API connection helper
|
||||||
|
|
Loading…
Reference in a new issue