Files
edx-platform/cms/static/js/views/partition_group_item.js
Syed Ali Abbas Zaidi f1fb38ed83 fix: multi lines and spaces issues (#31885)
* fix: multi lines and spaces issues

* fix: eslint operator-linebreak issue

* fix: eslint quotes issue

* fix: remaining quotes issues

* fix: eslint object curly newline issue

* fix: eslint object curly spacing issue

* fix: eslint brace-style issues

* fix: react jsx indent and props issues

* fix: eslint trailing spaces issues

* fix: eslint linbreak style issue

* fix: eslint space unary operator issue

* fix: eslint line around directives issue

* fix: void and typeof space unary ops issue
2023-05-03 12:22:46 +05:00

47 lines
1.3 KiB
JavaScript

/**
* This class defines an controller view for partition groups.
* It renders an editor view or a details view depending on the state
* of the underlying model.
* It is expected to be backed by a Group model.
*/
define([
'js/views/list_item', 'js/views/content_group_editor', 'js/views/partition_group_details',
'gettext', 'common/js/components/utils/view_utils'
], function(ListItemView, ContentGroupEditorView, PartitionGroupDetailsView, gettext) {
'use strict';
var PartitionGroupItemView = ListItemView.extend({
events: {
'click .delete': 'deleteItem'
},
tagName: 'section',
baseClassName: 'partition-group',
canDelete: true,
itemDisplayName: gettext('content group'),
attributes: function() {
return {
id: this.model.get('id'),
tabindex: -1
};
},
createEditView: function() {
return new ContentGroupEditorView({model: this.model});
},
createDetailsView: function() {
return new PartitionGroupDetailsView({
model: this.model,
restrictEditing: this.options.restrictEditing
});
}
});
return PartitionGroupItemView;
});