mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-01 23:38:37 +00:00
Merge pull request #2273 from haiwen/new-group-owned-repo-fix
[group] fixup for adding the first owned repo when there are no repos …
This commit is contained in:
commit
2ab9b5b900
@ -45,6 +45,8 @@ define([
|
|||||||
|
|
||||||
this.ownedRepos = new GroupOwnedRepos();
|
this.ownedRepos = new GroupOwnedRepos();
|
||||||
this.listenTo(this.ownedRepos, 'add', this.addOne);
|
this.listenTo(this.ownedRepos, 'add', this.addOne);
|
||||||
|
// for adding the first owned repo when there is no repos in the group.
|
||||||
|
this.listenTo(this.ownedRepos, 'reset', this.resetOwnedRepos);
|
||||||
|
|
||||||
this.settingsView = new GroupSettingsView({groupView: this});
|
this.settingsView = new GroupSettingsView({groupView: this});
|
||||||
this.membersView = new GroupMembersView({groupView: this});
|
this.membersView = new GroupMembersView({groupView: this});
|
||||||
@ -89,23 +91,27 @@ define([
|
|||||||
this.$tableHead.html(tmpl());
|
this.$tableHead.html(tmpl());
|
||||||
},
|
},
|
||||||
|
|
||||||
reset: function() {
|
reset: function(options) {
|
||||||
if (this.repos.length) {
|
var repos = options.repos || this.repos;
|
||||||
|
if (repos.length) {
|
||||||
this.$emptyTip.hide();
|
this.$emptyTip.hide();
|
||||||
this.renderThead();
|
this.renderThead();
|
||||||
this.$tableBody.empty();
|
this.$tableBody.empty();
|
||||||
|
|
||||||
// sort
|
// sort
|
||||||
Common.updateSortIconByMode({'context': this.$el});
|
Common.updateSortIconByMode({'context': this.$el});
|
||||||
Common.sortLibs({'libs': this.repos});
|
Common.sortLibs({'libs': repos});
|
||||||
|
|
||||||
this.repos.each(this.addOne, this);
|
repos.each(this.addOne, this);
|
||||||
this.$table.show();
|
this.$table.show();
|
||||||
} else {
|
} else {
|
||||||
this.showEmptyTip();
|
this.showEmptyTip();
|
||||||
this.$table.hide();
|
this.$table.hide();
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
resetOwnedRepos: function() {
|
||||||
|
this.reset({repos: this.ownedRepos});
|
||||||
},
|
},
|
||||||
|
|
||||||
showEmptyTip: function() {
|
showEmptyTip: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user