1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 14:42:10 +00:00

Merge pull request #1223 from haiwen/myhome-repos

update dir page
This commit is contained in:
Daniel Pan
2016-06-04 13:55:39 +08:00

View File

@@ -103,6 +103,9 @@ define([
this.$dirent_list = this.$('.repo-file-list');
this.$dirent_grid = this.$('.grid-view');
this.$dirent_list_body = this.$('.repo-file-list tbody');
this.$loading_tip = this.$('.loading-tip');
this.$error = this.$('.error');
this.$el_con = this.$('.repo-file-list-topbar, .js-dir-content');
this.$path_bar = this.$('.path');
// For compatible with css, we use .repo-op instead of .dir-op
@@ -341,6 +344,10 @@ define([
},
renderDir: function() {
this.$loading_tip.show();
this.$error.hide();
this.$el_con.show();
this.$dirent_grid.empty();
this.$dirent_list_body.empty();
@@ -352,8 +359,6 @@ define([
this.$dirent_grid.show();
}
var loading_tip = this.$('.loading-tip').show();
var _this = this;
var thumbnail_size = app.pageOptions.thumbnail_default_size;
if (this.view_mode == 'grid') {
@@ -368,12 +373,12 @@ define([
'thumbnail_size': thumbnail_size
},
success: function() {
loading_tip.hide();
_this.$loading_tip.hide();
},
error: function(collection, response, opts) {
loading_tip.hide();
_this.$el_con = _this.$('.repo-file-list-topbar, .js-dir-content').hide();
var $error = _this.$('.error');
_this.$loading_tip.hide();
_this.$el_con.hide();
var err_msg;
if (response.responseText) {
if (response.responseJSON.lib_need_decrypt) {
@@ -385,7 +390,7 @@ define([
} else {
err_msg = gettext('Please check the network.');
}
$error.html(err_msg).show();
_this.$error.html(err_msg).show();
}
});
},