Skip to content

Commit 6a0d55c

Browse files
author
Cameron Lamb
committed
Fix registering of JS
Thanks @alexgorji for the fix :)
1 parent 8fed5b7 commit 6a0d55c

File tree

1 file changed

+1
-19
lines changed

1 file changed

+1
-19
lines changed

wagtail_footnotes/wagtail_hooks.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,6 @@
88
from wagtail.core import hooks
99

1010

11-
@hooks.register("insert_editor_js")
12-
def editor_js():
13-
""" Includes uuidv4() function courtesy of
14-
https://stackoverflow.com/a/2117523/823020
15-
"""
16-
js_files = [
17-
# We require this file here to make sure it is loaded before footnotes.js.
18-
"wagtailadmin/js/draftail.js",
19-
"footnotes/js/footnotes.js",
20-
]
21-
js_includes = format_html_join(
22-
"\n",
23-
'<script src="{0}"></script>',
24-
((static(filename),) for filename in js_files),
25-
)
26-
return js_includes
27-
28-
2911
@hooks.register("register_rich_text_features")
3012
def register_footnotes_feature(features):
3113
"""
@@ -43,7 +25,7 @@ def register_footnotes_feature(features):
4325
feature_name,
4426
draftail_features.EntityFeature(
4527
control,
46-
# The JS for footnotes would have been passed here, see above.
28+
js = ['wagtailadmin/js/draftail.js', 'footnotes/js/footnotes.js']
4729
),
4830
)
4931

0 commit comments

Comments
 (0)