Files
edx-platform/lms/static/js/edxnotes/views/notes_page.js
Syed Ali Abbas Zaidi 8480dbc228 chore: apply amnesty on existing not fixable issues (#32215)
* 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 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

* fix: all autofixable eslint issues

* fix: all react related fixable issues

* fix: autofixable eslint issues

* chore: remove all template literals

* fix: remaining autofixable issues

* chore: apply amnesty on all existing issues

* fix: failing xss-lint issues

* refactor: apply amnesty on remaining issues

* refactor: apply amnesty on new issues

* fix: remove file level suppressions

* refactor: apply amnesty on new issues
2023-08-07 19:13:19 +05:00

74 lines
2.9 KiB
JavaScript

// eslint-disable-next-line no-shadow-restricted-names
(function(define, undefined) {
'use strict';
define([
'backbone', 'js/edxnotes/collections/tabs', 'js/edxnotes/views/tabs_list',
'js/edxnotes/views/tabs/recent_activity', 'js/edxnotes/views/tabs/course_structure',
'js/edxnotes/views/tabs/search_results', 'js/edxnotes/views/tabs/tags'
], function(
Backbone, TabsCollection, TabsListView, RecentActivityView, CourseStructureView,
SearchResultsView, TagsView
) {
var NotesPageView = Backbone.View.extend({
initialize: function(options) {
var scrollToTag, tagsModel;
this.options = options;
this.tabsCollection = new TabsCollection();
if (!_.contains(this.options.disabledTabs, 'tags')) {
// Must create the Tags view first to get the "scrollToTag" method.
this.tagsView = new TagsView({
el: this.el,
collection: this.collection,
tabsCollection: this.tabsCollection
});
scrollToTag = this.tagsView.scrollToTag;
// Remove the Tags model from the tabs collection because it should not appear first.
tagsModel = this.tabsCollection.shift();
}
this.recentActivityView = new RecentActivityView({
el: this.el,
collection: this.collection,
tabsCollection: this.tabsCollection,
scrollToTag: scrollToTag
});
if (!_.contains(this.options.disabledTabs, 'course_structure')) {
this.courseStructureView = new CourseStructureView({
el: this.el,
collection: this.collection,
tabsCollection: this.tabsCollection,
scrollToTag: scrollToTag
});
}
if (!_.contains(this.options.disabledTabs, 'tags')) {
// Add the Tags model after the Course Structure model.
this.tabsCollection.push(tagsModel);
}
this.searchResultsView = new SearchResultsView({
el: this.el,
tabsCollection: this.tabsCollection,
debug: this.options.debug,
perPage: this.options.perPage,
createTabOnInitialization: false,
scrollToTag: scrollToTag
});
this.tabsView = new TabsListView({collection: this.tabsCollection});
this.$('.tab-list')
.append(this.tabsView.render().$el)
.removeClass('is-hidden');
}
});
return NotesPageView;
});
}).call(this, define || RequireJS.define);