1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-20 10:58:33 +00:00
Files
seahub/static/scripts/app/routers/organization.js

36 lines
798 B
JavaScript
Raw Normal View History

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