1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-23 20:37:42 +00:00
Files
seahub/media/scripts/app/routers/group.js
2015-04-22 15:31:35 +08:00

43 lines
1.1 KiB
JavaScript

/*global define*/
define([
'jquery',
'backbone',
'app/collections/group-repos',
'app/views/group'
], function($, Backbone, Repos, GroupView) {
"use strict";
var GroupRouter = Backbone.Router.extend({
routes: {
'libs/:id(/*path)': 'showDirents',
'recent-changes': 'showRecentChanges',
// Default
'*actions': 'defaultAction'
},
initialize: function() {
this.groupView = new GroupView();
},
showDirents: function(id, path){
console.log("Repo route has been called.." + "id:" + id + " path:" + path);
// new GroupView().showDirentList(id, path);
},
showRecentChanges: function() {
console.log('recent changes');
this.groupView.showChanges();
},
defaultAction: function(actions){
// We have no matching route, lets just log what the URL was
console.log('No route:', actions);
this.groupView.showRepoList();
}
});
return GroupRouter;
});