1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 23:29:49 +00:00

Update group discussion

This commit is contained in:
Daniel Pan
2016-03-17 15:43:05 +08:00
committed by llj
parent 4aa500203d
commit 077a2627f0
7 changed files with 102 additions and 269 deletions

View File

@@ -18,6 +18,7 @@ define([
this.$loadingTip = this.$('.loading-tip');
this.$listContainer = this.$('#group-discussion-list');
this.$emptyTip = this.$('.no-discussion-tip');
this.$error = this.$('.error');
var _this = this;
@@ -59,9 +60,15 @@ define([
this.$error.hide();
this.$loadingTip.hide();
this.$listContainer.empty();
this.collection.each(this.addOne, this);
this.$listContainer.removeClass('hide');
this.$listContainer.show();
if (this.collection.length) {
this.$emptyTip.hide();
this.collection.each(this.addOne, this);
this.$listContainer.removeClass('hide');
this.$listContainer.show();
} else {
this.$emptyTip.show();
this.$listContainer.hide();
}
},
render: function() {
@@ -124,6 +131,9 @@ define([
prepend: true,
success: function() {
_this.$('[name="message"]').val('');
if (_this.collection.length == 1) {
_this.collection.reset(_this.collection.models);
}
},
error: function(collection, response, options) {
var err_msg;