Skip to content

Commit 8a70e8f

Browse files
committed
do not load javascript if javscript is disabled
1 parent f27756f commit 8a70e8f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bootstrap4/templatetags/bootstrap4.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,10 @@ def bootstrap_javascript_url():
185185
186186
{% bootstrap_javascript_url %}
187187
"""
188-
return javascript_url()
188+
if not get_bootstrap_setting('use_javascript'):
189+
return None
190+
else:
191+
return javascript_url()
189192

190193

191194
@register.simple_tag
@@ -339,6 +342,9 @@ def bootstrap_javascript(jquery="falsy"):
339342
{% bootstrap_javascript jquery="slim" %}
340343
"""
341344

345+
if not get_bootstrap_setting('use_javascript'):
346+
return None
347+
342348
# List of JS tags to include
343349
javascript_tags = []
344350

0 commit comments

Comments
 (0)