What I implemented right now is still basic.
In settings.py, the delay for auto-dismiss message and the duration of the fadeout are configured.
HORIZON_CONFIG = { .. 'data_dismiss_delay': 3000, 'data_dismiss_fade_duration': 1500, .}
In _messages.html, define what messages you want to auto-fade by adding the attribute data-dismiss-auto="true"
<div class="alert alert-block alert-success fade in" data-dismiss-auto="true"> <a class="close" data-dismiss="alert" href="#">×</a> <p><strong>{% trans "Success: " %}</strong>{{ message }}</p> </div>
Another alternative configuration I could this of is:
HORIZON_CONFIG = { .. 'auto_fade_message': { 'delay': 3000, 'fade_duration': 1500, 'alerts' : ['success', 'info'] }, .. }
The alerts takes a list of alert type where the auto-fade will be applied. By default the alerts can be an empty list to fallback to default behavior of no auto-fade.
What I implemented right now is still basic.
In settings.py, the delay for auto-dismiss message and the duration of the fadeout are configured.
HORIZON_CONFIG = { dismiss_ delay': 3000, dismiss_ fade_duration' : 1500,
..
'data_
'data_
.}
In _messages.html, define what messages you want to auto-fade by adding the attribute data-dismiss- auto="true"
<div class="alert alert-block alert-success fade in" data-dismiss- auto="true" > "alert" href="# ">× </a>
<a class="close" data-dismiss=
<p><strong>{% trans "Success: " %}</strong>{{ message }}</p>
</div>
Another alternative configuration I could this of is:
HORIZON_CONFIG = { fade_message' : {
'fade_ duration' : 1500,
..
'auto_
'delay': 3000,
'alerts' : ['success', 'info']
},
..
}
The alerts takes a list of alert type where the auto-fade will be applied. By default the alerts can be an empty list to fallback to default behavior of no auto-fade.