* 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
38 lines
1.4 KiB
JavaScript
38 lines
1.4 KiB
JavaScript
// eslint-disable-next-line no-shadow-restricted-names
|
|
(function(define, undefined) {
|
|
'use strict';
|
|
|
|
define([
|
|
'jquery', 'js/edxnotes/collections/notes', 'js/edxnotes/views/notes_page'
|
|
], function($, NotesCollection, NotesPageView) {
|
|
/**
|
|
* Factory method for the Notes page.
|
|
* @param {Object} params Params for the Notes page.
|
|
* @param {List} params.disabledTabs Names of disabled tabs, these tabs will not be shown.
|
|
* @param {Object} params.notes Paginated notes info.
|
|
* @param {Number} params.pageSize Number of notes per page.
|
|
* @param {Boolean} params.debugMode Enable the flag to see debug information.
|
|
* @param {String} params.endpoint The endpoint of the store.
|
|
* @return {Object} An instance of NotesPageView.
|
|
*/
|
|
return function(params) {
|
|
var collection = new NotesCollection(
|
|
params.notes,
|
|
{
|
|
url: params.notesEndpoint,
|
|
perPage: params.pageSize,
|
|
parse: true
|
|
}
|
|
);
|
|
|
|
return new NotesPageView({
|
|
el: $('.wrapper-student-notes').get(0),
|
|
collection: collection,
|
|
debug: params.debugMode,
|
|
perPage: params.pageSize,
|
|
disabledTabs: params.disabledTabs
|
|
});
|
|
};
|
|
});
|
|
}).call(this, define || RequireJS.define);
|