1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 07:08:55 +00:00

[side nav] modified for myhome & org

This commit is contained in:
llj
2015-04-11 18:03:43 +08:00
committed by Daniel Pan
parent fd3a150717
commit a18b3297bf
3 changed files with 34 additions and 18 deletions

View File

@@ -16,13 +16,10 @@ define([
el: '#main',
initialize: function() {
//_.bindAll(this, 'ajaxLoadingShow', 'ajaxLoadingHide');
//this.$el.ajaxStart(this.ajaxLoadingShow).ajaxStop(this.ajaxLoadingHide);
this.$cont = this.$('#right-panel');
this.$sideNav = $('#myhome-side-nav');
this.reposView = new ReposView();
this.subReposView = new SubReposView();
this.sharedReposView = new SharedReposView();
@@ -32,6 +29,9 @@ define([
$('#initial-loading-view').hide();
},
showSideNav: function () {
this.$sideNav.show();
},
ajaxLoadingShow: function() {
Common.feedback('Loading...', 'info', Common.INFO_TIMEOUT);
@@ -50,24 +50,28 @@ define([
},
showMyRepos: function() {
this.showSideNav();
this.currentView.hide();
this.reposView.show();
this.currentView = this.reposView;
},
showMySubRepos: function() {
this.showSideNav();
this.currentView.hide();
this.subReposView.show();
this.currentView = this.subReposView;
},
showSharedRepos: function() {
this.showSideNav();
this.currentView.hide();
this.sharedReposView.show();
this.currentView = this.sharedReposView;
},
showDir: function(category, repo_id, path) {
this.showSideNav();
var path = path || '/';
this.currentView.hide();
this.dirView.showDir(category, repo_id, path);
@@ -76,9 +80,9 @@ define([
hide: function() {
this.currentView.hide();
this.$sideNav.hide();
}
});
return MyHomeView;

View File

@@ -16,6 +16,7 @@ define([
initialize: function() {
this.$sideNav = $('#org-side-nav');
this.$reposDiv = $('#organization-repos');
this.$table = $('#organization-repos table');
this.$tableBody = $('tbody', this.$table);
@@ -62,6 +63,7 @@ define([
},
showRepoList: function() {
this.$sideNav.show();
this.dirView.hide();
this.$reposDiv.show();
this.repos.fetch({reset: true});
@@ -73,6 +75,7 @@ define([
},
showDir: function(repo_id, path) {
this.$sideNav.show();
var path = path || '/';
this.hideRepoList();
this.dirView.showDir('org', repo_id, path);
@@ -83,7 +86,6 @@ define([
sortByName: function() {
var repos = this.repos;
console.log(repos);
var el = $('.by-name', this.$table);
repos.comparator = function(a, b) { // a, b: model
if (el.hasClass('icon-caret-up')) {
@@ -115,6 +117,7 @@ define([
},
hide: function() {
this.$sideNav.hide();
this.hideRepoList();
this.dirView.hide();
}