diff --git a/cms/djangoapps/contentstore/views/preview.py b/cms/djangoapps/contentstore/views/preview.py index 9c9926a5b25d..2831a6ebb392 100644 --- a/cms/djangoapps/contentstore/views/preview.py +++ b/cms/djangoapps/contentstore/views/preview.py @@ -328,6 +328,7 @@ def _studio_wrap_xblock(xblock, view, frag, context, display_name_only=False): } add_webpack_js_to_fragment(frag, "js/factories/xblock_validation") + add_webpack_js_to_fragment(frag, "js/factories/tag_count") html = render_to_string('studio_xblock_wrapper.html', template_context) frag = wrap_fragment(frag, html) diff --git a/cms/templates/studio_xblock_wrapper.html b/cms/templates/studio_xblock_wrapper.html index 282629456633..b6c627e6dcb3 100644 --- a/cms/templates/studio_xblock_wrapper.html +++ b/cms/templates/studio_xblock_wrapper.html @@ -44,17 +44,14 @@ ${bool(block_is_unit) | n, dump_js_escaped_json}, // block_is_unit will be None or a boolean $('div.xblock-validation-messages[data-locator="${xblock.location | n, js_escaped_string}"]') ); - - -<%static:webpack entry="js/factories/tag_count"> TagCountFactory({ - tags_count: "${tags_count | n, js_escaped_string}", - content_id: "${xblock.location | n, js_escaped_string}", - course_authoring_url: "${course_authoring_url | n, js_escaped_string}", - }, + tags_count: "${tags_count | n, js_escaped_string}", + content_id: "${xblock.location | n, js_escaped_string}", + course_authoring_url: "${course_authoring_url | n, js_escaped_string}", + }, $('li.tag-count[data-locator="${xblock.location | n, js_escaped_string}"]') ); - + % if not is_root: % if is_reorderable: