Skip to content

Commit 13b72f6

Browse files
committed
do not load javascript if javscript is disabled
1 parent f60e9f8 commit 13b72f6

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
@@ -157,7 +157,10 @@ def bootstrap_javascript_url():
157157
158158
{% bootstrap_javascript_url %}
159159
"""
160-
return javascript_url()
160+
if not get_bootstrap_setting('use_javascript'):
161+
return None
162+
else:
163+
return javascript_url()
161164

162165

163166
@register.simple_tag
@@ -311,6 +314,9 @@ def bootstrap_javascript(jquery='falsy'):
311314
{% bootstrap_javascript jquery="slim" %}
312315
"""
313316

317+
if not get_bootstrap_setting('use_javascript'):
318+
return None
319+
314320
# List of JS tags to include
315321
javascript_tags = []
316322

0 commit comments

Comments
 (0)