1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-06-22 21:27:30 +00:00
seahub/static/scripts/sysadmin-app/collection/dirents.js

31 lines
779 B
JavaScript
Raw Normal View History

2016-05-25 02:45:22 +00:00
define([
'underscore',
'backbone',
'common',
2016-05-27 08:42:40 +00:00
'sysadmin-app/models/dirent'
], function(_, Backbone, Common, DirentModel) {
2016-05-25 02:45:22 +00:00
'use strict';
2016-05-27 08:42:40 +00:00
var DirentCollection = Backbone.Collection.extend({
model: DirentModel,
url: function() {
return Common.getUrl({name: 'admin-library-dirents', repo_id: this.repo_id});
},
parse: function(data) {
2016-05-25 02:45:22 +00:00
this.repo_name = data.repo_name;
this.repo_id = data.repo_id;
this.is_system_library = data.is_system_library;
return data.dirent_list; // return the array
},
2016-05-25 02:45:22 +00:00
setPath: function(repo_id, path) {
this.repo_id = repo_id;
this.path = path;
}
});
2016-05-27 08:42:40 +00:00
return DirentCollection;
2016-05-25 02:45:22 +00:00
});