1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-18 23:18:27 +00:00
seahub/media/scripts/app/routers/myhome.js

37 lines
912 B
JavaScript
Raw Normal View History

/*global define*/
define([
'jquery',
'backbone',
'app/collections/repos',
'app/views/myhome'
], function($, Backbone, Repos, MyHomeView) {
"use strict";
var MyHomeRouter = Backbone.Router.extend({
routes: {
2015-01-25 10:47:42 +00:00
'lib/:repo_id(/*path)': 'showDir',
// Default
'*actions': 'defaultAction'
},
showDir: function(repo_id, path) {
if (path)
path = '/' + path;
else
path = '/';
console.log("Repo route has been called.." + "repo_id:" + repo_id + " path:" + path);
new MyHomeView().showDir(repo_id, path);
},
defaultAction: function(actions) {
// We have no matching route, lets just log what the URL was
console.log('No route:', actions);
new MyHomeView().showRepoList();
}
});
return MyHomeRouter;
});