1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-18 23:18:27 +00:00
seahub/static/scripts/app/routers/organization.js
2015-04-22 15:31:46 +08:00

36 lines
798 B
JavaScript

/*global define*/
define([
'jquery',
'backbone',
'app/views/organization'
], function($, Backbone, OrganizationView) {
"use strict";
var OrganizationRouter = Backbone.Router.extend({
routes: {
'lib/:repo_id(/*path)': 'showDir',
// Default
'*actions': 'defaultAction'
},
initialize: function() {
this.orgView = new OrganizationView();
},
showDir: function(repo_id, path) {
if (path) {
path = '/' + path;
} else {
path = '/';
}
this.orgView.showDir(repo_id, path);
},
defaultAction: function(){
this.orgView.showPublicRepos();
}
});
return OrganizationRouter;
});