mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-23 12:27:48 +00:00
Move scripts from media to static folder
This commit is contained in:
35
static/scripts/app/routers/organization.js
Normal file
35
static/scripts/app/routers/organization.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/*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;
|
||||
});
|
Reference in New Issue
Block a user