Files
edx-platform/lms/static/js/discovery/views/facet.js
Eric Fischer 5bc6b31e29 eslint --fix
2017-12-08 14:38:41 -05:00

34 lines
841 B
JavaScript

(function(define) {
define([
'jquery',
'underscore',
'backbone',
'gettext'
], function($, _, Backbone, gettext) {
'use strict';
return Backbone.View.extend({
tagName: 'li',
templateId: '#search_facet-tpl',
className: '',
initialize: function() {
this.tpl = _.template($(this.templateId).html());
},
render: function(type, name, term, count) {
this.$el.html(this.tpl({name: name, term: term, count: count}));
this.$el.attr('data-facet', type);
return this;
},
remove: function() {
this.stopListening();
this.$el.remove();
}
});
});
}(define || RequireJS.define));