mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-29 09:52:36 +02:00
Position flash messages with CSS rather than JS (#292)
Visual result is exactly the same, but less black magic :-).
This commit is contained in:
parent
4d359ce11b
commit
f2a53eb1e3
2 changed files with 11 additions and 6 deletions
|
@ -245,8 +245,13 @@ tr.payer_line .balance-name{
|
|||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.flash {
|
||||
.messages {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
top: 0.6rem;
|
||||
width: 100%;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.light {
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
{% block head %}{% endblock %}
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(document).ready(function(){
|
||||
var left = window.innerWidth/2-$('.flash').width()/2;
|
||||
$(".flash").css({ "left": left+"px", "top":"0.6rem" });
|
||||
setTimeout(function(){
|
||||
$(".flash").fadeOut("slow", function () {
|
||||
$(".flash").remove();
|
||||
|
@ -80,9 +78,11 @@
|
|||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% for message in get_flashed_messages() %}
|
||||
<div class="flash alert alert-success">{{ message }}</div>
|
||||
{% endfor %}
|
||||
<div class="messages">
|
||||
{% for message in get_flashed_messages() %}
|
||||
<div class="flash alert alert-success">{{ message }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% block footer %}
|
||||
<footer>
|
||||
|
|
Loading…
Reference in a new issue