From b383846e87f406f1351403baf79acd50782eae90 Mon Sep 17 00:00:00 2001 From: llj Date: Wed, 18 Apr 2018 16:39:20 +0800 Subject: [PATCH] [group discussion] fixup for 'enable' option --- media/css/seahub.css | 6 ------ seahub/templates/js/templates.html | 2 -- static/scripts/app/router.js | 7 ++++++- static/scripts/app/views/group-members.js | 7 ++++++- static/scripts/app/views/group-settings.js | 6 +++++- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/media/css/seahub.css b/media/css/seahub.css index 8fbef56bb0..987251a488 100644 --- a/media/css/seahub.css +++ b/media/css/seahub.css @@ -3680,12 +3680,6 @@ img.thumbnail { top:90px; right:0; } -#group-members .outer-caret { - right:66px; -} -#group-settings .outer-caret { - right:106px; -} .group-setting-list { border-bottom:1px solid #e3e3e5; } diff --git a/seahub/templates/js/templates.html b/seahub/templates/js/templates.html index d97ad509ed..1444baff3d 100644 --- a/seahub/templates/js/templates.html +++ b/seahub/templates/js/templates.html @@ -1437,8 +1437,6 @@ <% if (app.pageOptions.enable_group_discussion) { %> - <% } else { %> - <% } %> diff --git a/static/scripts/app/router.js b/static/scripts/app/router.js index ee91538342..200784b565 100644 --- a/static/scripts/app/router.js +++ b/static/scripts/app/router.js @@ -237,7 +237,12 @@ define([ }, showGroupDiscussions: function(group_id) { - this.showGroup(group_id, {showDiscussions: true}); + if (app.pageOptions.enable_group_discussion) { + this.showGroup(group_id, {showDiscussions: true}); + } else { + this.showGroup(group_id); + app.router.navigate('group/' + group_id + '/'); + } }, showOrgRepos: function() { diff --git a/static/scripts/app/views/group-members.js b/static/scripts/app/views/group-members.js index dda6f6caff..723b857a73 100644 --- a/static/scripts/app/views/group-members.js +++ b/static/scripts/app/views/group-members.js @@ -82,7 +82,12 @@ define([ _this.$error.html(err_msg).show(); } }); - $("#group-members-icon").after(this.$el); + + var $icon = $("#group-members-icon"); + $icon.after(this.$el); + $('.outer-caret', this.$el).css({ + 'right': $('#group').width() - $icon.position().left - $icon.width() + }); } }); diff --git a/static/scripts/app/views/group-settings.js b/static/scripts/app/views/group-settings.js index 2371c27e8b..429ce030d3 100644 --- a/static/scripts/app/views/group-settings.js +++ b/static/scripts/app/views/group-settings.js @@ -53,7 +53,11 @@ define([ 'wiki_enabled': this.groupView.group.wiki_enabled })); - $("#group-settings-icon").after(this.$el); + var $icon = $("#group-settings-icon"); + $icon.after(this.$el); + $('.outer-caret', this.$el).css({ + 'right': $('#group').width() - $icon.position().left - $icon.width() + }); }, highlightItem: function(e) {