Files
edx-platform/cms/static/js/views/components/add_xblock_menu.js
Syed Ali Abbas Zaidi 228180b1ef fix: all auto fixable eslint issues (#31900)
* fix: eslint operator-linebreak issue

* fix: eslint quotes issue

* fix: react jsx indent and props issues

* fix: eslint trailing spaces issues

* fix: eslint line around directives issue

* fix: eslint prefer template issue

* fix: eslint semi rule

* fix: eslint newline per chain rule

* fix: eslint space infix ops rule

* fix: eslint space-in-parens issue

* fix: eslint space before function paren issue

* fix: eslint space before blocks issue

* fix: eslint arrow body style issue

* fix: eslint dot-location issue

* fix: eslint quotes issue

* fix: eslint quote props issue

* fix: eslint operator assignment issue

* fix: eslint new line after import issue

* fix: indent issues

* fix: operator assignment issue
2023-05-09 11:57:15 +05:00

30 lines
1.5 KiB
JavaScript

define(['jquery', 'js/views/baseview', 'edx-ui-toolkit/js/utils/html-utils'],
function($, BaseView, HtmlUtils) {
return BaseView.extend({
className: function() {
return `new-component-templates new-component-${this.model.type}`;
},
initialize: function() {
BaseView.prototype.initialize.call(this);
var template_name = this.model.type === 'problem' ? 'add-xblock-component-menu-problem'
: 'add-xblock-component-menu';
var support_indicator_template = this.loadTemplate('add-xblock-component-support-level');
var support_legend_template = this.loadTemplate('add-xblock-component-support-legend');
this.template = this.loadTemplate(template_name);
HtmlUtils.setHtml(
this.$el,
HtmlUtils.HTML(this.template({
type: this.model.type,
templates: this.model.templates,
support_legend: this.model.support_legend,
support_indicator_template: support_indicator_template,
support_legend_template: support_legend_template,
HtmlUtils: HtmlUtils
}))
);
// Make the tabs on problems into "real tabs"
this.$('.tab-group').tabs();
}
});
}); // end define();