mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
enable 'show error' for 'fetch libs'
Conflicts: static/scripts/app/views/group.js static/scripts/app/views/myhome-repos.js static/scripts/app/views/myhome-shared-repos.js static/scripts/app/views/organization.js
This commit is contained in:
@@ -56,25 +56,47 @@ define([
|
||||
},
|
||||
|
||||
reset: function() {
|
||||
this.renderReposHd();
|
||||
this.$tableBody.empty();
|
||||
this.repos.each(this.addOne, this);
|
||||
this.$('.error').hide();
|
||||
this.$loadingTip.hide();
|
||||
if (this.repos.length) {
|
||||
this.$emptyTip.hide();
|
||||
this.renderReposHd();
|
||||
this.$tableBody.empty();
|
||||
this.repos.each(this.addOne, this);
|
||||
this.$table.show();
|
||||
} else {
|
||||
this.$emptyTip.show();
|
||||
this.$table.hide();
|
||||
this.$emptyTip.show();
|
||||
}
|
||||
this.$loadingTip.hide();
|
||||
},
|
||||
|
||||
showRepoList: function() {
|
||||
this.$sideNav.show();
|
||||
this.dirView.hide();
|
||||
this.$reposDiv.show();
|
||||
this.repos.fetch({reset: true});
|
||||
this.$loadingTip.show();
|
||||
var $loadingTip = this.$loadingTip;
|
||||
$loadingTip.show();
|
||||
var _this = this;
|
||||
this.repos.fetch({
|
||||
reset: true,
|
||||
success: function (collection, response, opts) {
|
||||
},
|
||||
error: function (collection, response, opts) {
|
||||
$loadingTip.hide();
|
||||
var $error = _this.$('.error');
|
||||
var err_msg;
|
||||
if (response.responseText) {
|
||||
if (response['status'] == 401 || response['status'] == 403) {
|
||||
err_msg = gettext("Permission error");
|
||||
} else {
|
||||
err_msg = gettext("Error");
|
||||
}
|
||||
} else {
|
||||
err_msg = gettext('Please check the network.');
|
||||
}
|
||||
$error.html(err_msg).show();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
hideRepoList: function() {
|
||||
|
Reference in New Issue
Block a user