Skip to content

Commit

Permalink
Merge pull request #2510 from NCEAS/bugfix-2395-citations-display
Browse files Browse the repository at this point in the history
Bugfix 2395 citations display
  • Loading branch information
robyngit authored Sep 5, 2024
2 parents 96526a8 + 82cb423 commit 1094b26
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 75 deletions.
17 changes: 9 additions & 8 deletions src/js/collections/Citations.js
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
"use strict";

define(["jquery", "underscore", "backbone", "models/CitationModel"], function (
define(["jquery", "underscore", "backbone", "models/CitationModel"], (
$,
_,
Backbone,
CitationModel,
) {
) => {
/**
* @class Citations
* @classdesc Citations represents the Citations list
* found at https://app.swaggerhub.com/apis/nenuji/data-metrics/1.0.0.3.
* For details regarding a single Citation Entity, refer `models/CitationModel`
* @classcategory Collections
* @name Citations
* @extends Backbone.Collection
* @constructor
* @augments Backbone.Collection
* @class
*/
var Citations = Backbone.Collection.extend(
const Citations = Backbone.Collection.extend(
/** @lends Citations.prototype */ {
// eslint-disable-next-line object-shorthand
model: function (attrs, options) {
// We use the inline require here in addition to the define above to
// avoid an issue caused by the circular dependency between
// CitationModel and Citations
var CitationModel = require("models/CitationModel");
const CitationModel = require("models/CitationModel");
return new CitationModel(attrs, options);
},

//The name of this type of collection
// The name of this type of collection
type: "Citations",

// Used for sorting the year in the reverse Chronological order
comparator: function (model) {
comparator(model) {
return -model.get("year_of_publishing"); // Note the minus!
},
},
Expand Down
Loading

0 comments on commit 1094b26

Please sign in to comment.