diff --git a/lms/static/js/discovery/views/filter_bar.js b/lms/static/js/discovery/views/filter_bar.js index 5f8ba9dc87..2bc0561075 100644 --- a/lms/static/js/discovery/views/filter_bar.js +++ b/lms/static/js/discovery/views/filter_bar.js @@ -5,8 +5,9 @@ 'backbone', 'gettext', 'js/discovery/models/filter', - 'js/discovery/views/filter_label' - ], function($, _, Backbone, gettext, Filter, FilterLabel) { + 'js/discovery/views/filter_label', + 'edx-ui-toolkit/js/utils/html-utils' + ], function($, _, Backbone, gettext, Filter, FilterLabel, HtmlUtils) { 'use strict'; return Backbone.View.extend({ @@ -20,7 +21,7 @@ }, initialize: function() { - this.tpl = _.template($(this.templateId).html()); + this.tpl = HtmlUtils.template($(this.templateId).html()); this.render(); this.listenTo(this.collection, 'remove', this.hideIfEmpty); this.listenTo(this.collection, 'add', this.addFilter); @@ -28,7 +29,10 @@ }, render: function() { - this.$el.html(this.tpl()); + HtmlUtils.setHtml( + this.$el, + this.tpl() + ); this.$ul = this.$el.find('ul'); this.$el.addClass('is-animated'); return this;