/src/Oro/Bundle/NoteBundle/Resources/public/js/note/collection.js
https://github.com/diimpp/platform · JavaScript · 28 lines · 18 code · 4 blank · 6 comment · 0 complexity · fc4848e8841d2267d8f5f6c1aa55fe69 MD5 · raw file
- /*global define*/
- define(['underscore', 'backbone', 'oronote/js/note/model'],
- function (_, Backbone, NoteModel) {
- 'use strict';
- /**
- * @export oronote/js/note/collection
- * @class oronote.note.Collection
- * @extends Backbone.Collection
- */
- return Backbone.Collection.extend({
- model: NoteModel,
- baseUrl: '',
- sorting: 'DESC',
- url: function () {
- return this.baseUrl + '?sorting=' + this.sorting;
- },
- getSorting: function () {
- return this.sorting;
- },
- setSorting: function (mode) {
- this.sorting = mode;
- }
- });
- });