From dc373c956d227ae30a63c90da3ede484b482d498 Mon Sep 17 00:00:00 2001 From: Daniel Pan Date: Sun, 20 Mar 2016 11:28:03 +0800 Subject: [PATCH] Improve group discussion --- seahub/templates/js/templates.html | 2 +- seahub/templates/libraries.html | 22 +++++++++---------- static/scripts/app/views/group-discussion.js | 2 ++ static/scripts/app/views/group-discussions.js | 11 +++++++++- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/seahub/templates/js/templates.html b/seahub/templates/js/templates.html index 3e373f65e4..e9c17b6436 100644 --- a/seahub/templates/js/templates.html +++ b/seahub/templates/js/templates.html @@ -985,7 +985,7 @@
-
+
{% trans "Reply" %} {% trans "Delete" %}
diff --git a/seahub/templates/libraries.html b/seahub/templates/libraries.html index 3c55f41eae..0dc0a8843e 100644 --- a/seahub/templates/libraries.html +++ b/seahub/templates/libraries.html @@ -163,19 +163,19 @@ -
-
{% csrf_token %} - -
- -
- -
-
-
-

+
diff --git a/static/scripts/app/views/group-discussion.js b/static/scripts/app/views/group-discussion.js index 67cf395e0c..c8936ec669 100644 --- a/static/scripts/app/views/group-discussion.js +++ b/static/scripts/app/views/group-discussion.js @@ -46,10 +46,12 @@ define([ highlight: function() { this.$el.addClass('hl'); + this.$('.msg-ops').show(); }, rmHighlight: function() { this.$el.removeClass('hl'); + this.$('.msg-ops').hide(); }, reply: function() { diff --git a/static/scripts/app/views/group-discussions.js b/static/scripts/app/views/group-discussions.js index 26fc1b25ad..c6d1157bdc 100644 --- a/static/scripts/app/views/group-discussions.js +++ b/static/scripts/app/views/group-discussions.js @@ -18,6 +18,7 @@ define([ this.$loadingTip = this.$('.loading-tip'); this.$listContainer = this.$('#group-discussion-list'); + this.$content = this.$('.popover-con'); this.$emptyTip = this.$('.no-discussion-tip'); this.$error = this.$('.error'); @@ -66,6 +67,7 @@ define([ this.collection.each(this.addOne, this); this.$listContainer.removeClass('hide'); this.$listContainer.show(); + this.$content.scrollTop(9999); } else { this.$emptyTip.show(); this.$listContainer.hide(); @@ -102,7 +104,14 @@ define([ // set max-height for '.popover-con' setConMaxHeight: function() { - this.$('.popover-con').css({'max-height': $(window).height() - this.$el.offset().top - this.$('.popover-hd').outerHeight(true) - 2}); // 2: top, bottom border width of $el + this.$('.popover-con').css({ + 'max-height': $(window).height() - this.$el.offset().top + - this.$('.popover-hd').outerHeight(true) + - this.$('.popover-footer').outerHeight(true) + - 2 + - 10 + }); // 2: top, bottom border width of $el, + // 10: leave some margin at the bottom }, show: function(options) {