mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-29 17:52:37 +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;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.flash {
|
.messages {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
top: 0.6rem;
|
||||||
|
width: 100%;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.light {
|
.light {
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
{% block head %}{% endblock %}
|
{% block head %}{% endblock %}
|
||||||
<script type="text/javascript" charset="utf-8">
|
<script type="text/javascript" charset="utf-8">
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
var left = window.innerWidth/2-$('.flash').width()/2;
|
|
||||||
$(".flash").css({ "left": left+"px", "top":"0.6rem" });
|
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
$(".flash").fadeOut("slow", function () {
|
$(".flash").fadeOut("slow", function () {
|
||||||
$(".flash").remove();
|
$(".flash").remove();
|
||||||
|
@ -80,9 +78,11 @@
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% for message in get_flashed_messages() %}
|
<div class="messages">
|
||||||
<div class="flash alert alert-success">{{ message }}</div>
|
{% for message in get_flashed_messages() %}
|
||||||
{% endfor %}
|
<div class="flash alert alert-success">{{ message }}</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
{% block footer %}
|
{% block footer %}
|
||||||
<footer>
|
<footer>
|
||||||
|
|
Loading…
Reference in a new issue