2015-01-20 10:25:10 +00:00
|
|
|
define([
|
|
|
|
'underscore',
|
|
|
|
'backbone',
|
|
|
|
'app/models/repo'
|
|
|
|
], function(_, Backbone, Repo) {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var RepoCollection = Backbone.Collection.extend({
|
|
|
|
model: Repo,
|
2015-01-31 05:17:47 +00:00
|
|
|
url: app.pageOptions.reposUrl,
|
2015-01-20 10:25:10 +00:00
|
|
|
|
|
|
|
initialize: function() {
|
2015-02-01 06:15:00 +00:00
|
|
|
//console.log('init RepoCollection');
|
2015-01-31 05:17:47 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
fetch: function(options) {
|
|
|
|
// override default fetch url
|
|
|
|
options = options ? _.clone(options) : {};
|
|
|
|
options.url = this.url + '?type=mine'
|
|
|
|
|
|
|
|
//call Backbone's fetch
|
|
|
|
return Backbone.Collection.prototype.fetch.call(this, options);
|
2015-01-20 10:25:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
2015-02-01 06:15:00 +00:00
|
|
|
return RepoCollection;
|
2015-01-20 10:25:10 +00:00
|
|
|
});
|