1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-24 09:41:04 +00:00
seahub/media/scripts/app/routers/group.js

43 lines
1.1 KiB
JavaScript
Raw Normal View History

2015-01-21 14:22:34 +00:00
/*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',
2015-01-29 06:45:26 +00:00
'recent-changes': 'showRecentChanges',
2015-01-21 14:22:34 +00:00
// Default
'*actions': 'defaultAction'
},
2015-01-29 06:45:26 +00:00
initialize: function() {
this.groupView = new GroupView();
},
2015-01-21 14:22:34 +00:00
showDirents: function(id, path){
console.log("Repo route has been called.." + "id:" + id + " path:" + path);
2015-01-27 09:32:31 +00:00
// new GroupView().showDirentList(id, path);
2015-01-21 14:22:34 +00:00
},
2015-01-29 06:45:26 +00:00
showRecentChanges: function() {
console.log('recent changes');
this.groupView.showChanges();
},
2015-01-21 14:22:34 +00:00
defaultAction: function(actions){
// We have no matching route, lets just log what the URL was
console.log('No route:', actions);
2015-01-29 06:45:26 +00:00
this.groupView.showRepoList();
2015-01-21 14:22:34 +00:00
}
});
return GroupRouter;
});