PageRenderTime 369ms CodeModel.GetById 25ms RepoModel.GetById 22ms app.codeStats 0ms

/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
  1. /*global define*/
  2. define(['underscore', 'backbone', 'oronote/js/note/model'],
  3. function (_, Backbone, NoteModel) {
  4. 'use strict';
  5. /**
  6. * @export oronote/js/note/collection
  7. * @class oronote.note.Collection
  8. * @extends Backbone.Collection
  9. */
  10. return Backbone.Collection.extend({
  11. model: NoteModel,
  12. baseUrl: '',
  13. sorting: 'DESC',
  14. url: function () {
  15. return this.baseUrl + '?sorting=' + this.sorting;
  16. },
  17. getSorting: function () {
  18. return this.sorting;
  19. },
  20. setSorting: function (mode) {
  21. this.sorting = mode;
  22. }
  23. });
  24. });