Skip to content

Commit 9a21dc3

Browse files
author
A. Svensson
committed
Added note for dismissable message alerts in docs.
1 parent c0c4193 commit 9a21dc3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

bootstrap3/templatetags/bootstrap3.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ def bootstrap_css():
155155
@register.simple_tag
156156
def bootstrap_javascript(jquery=None):
157157
"""
158-
Return HTML for Bootstrap JavaScript
158+
Return HTML for Bootstrap JavaScript.
159+
159160
Adjust url in settings. If no url is returned, we don't want this statement to return any HTML.
160161
This is intended behavior.
161162
@@ -486,7 +487,11 @@ def render(self, context):
486487
@register.simple_tag(takes_context=True)
487488
def bootstrap_messages(context, *args, **kwargs):
488489
"""
489-
Show django.contrib.messages Messages in Bootstrap alert containers
490+
Show django.contrib.messages Messages in Bootstrap alert containers.
491+
492+
In order to make the alerts dismissable (with the close button),
493+
we have to set the jquery parameter too when using the
494+
bootstrap_javascript tag.
490495
491496
**Tag name**::
492497
@@ -504,6 +509,7 @@ def bootstrap_messages(context, *args, **kwargs):
504509
505510
**example**::
506511
512+
{% bootstrap_javascript jquery=1 %}
507513
{% bootstrap_messages FIXTHIS %}
508514
509515
"""

0 commit comments

Comments
 (0)