mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-27 23:16:58 -04:00
rjs -> webpack
This commit is contained in:
@@ -1,31 +1,20 @@
|
||||
'use strict';
|
||||
var Backbone = require('backbone');
|
||||
var IndexerModel = require('./IndexerModel');
|
||||
|
||||
define([
|
||||
'backbone',
|
||||
'Settings/Indexers/IndexerModel'
|
||||
], function (Backbone, IndexerModel) {
|
||||
|
||||
return Backbone.Collection.extend({
|
||||
model: IndexerModel,
|
||||
url : window.NzbDrone.ApiRoot + '/indexer',
|
||||
|
||||
comparator : function(left, right, collection) {
|
||||
|
||||
var result = 0;
|
||||
|
||||
if (left.get('protocol')) {
|
||||
result = -left.get('protocol').localeCompare(right.get('protocol'));
|
||||
}
|
||||
|
||||
if (result === 0 && left.get('name')) {
|
||||
result = left.get('name').localeCompare(right.get('name'));
|
||||
}
|
||||
|
||||
if (result === 0) {
|
||||
result = left.get('implementation').localeCompare(right.get('implementation'));
|
||||
}
|
||||
|
||||
return result;
|
||||
module.exports = Backbone.Collection.extend({
|
||||
model : IndexerModel,
|
||||
url : window.NzbDrone.ApiRoot + '/indexer',
|
||||
comparator : function(left, right, collection){
|
||||
var result = 0;
|
||||
if(left.get('protocol')) {
|
||||
result = -left.get('protocol').localeCompare(right.get('protocol'));
|
||||
}
|
||||
});
|
||||
});
|
||||
if(result === 0 && left.get('name')) {
|
||||
result = left.get('name').localeCompare(right.get('name'));
|
||||
}
|
||||
if(result === 0) {
|
||||
result = left.get('implementation').localeCompare(right.get('implementation'));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user