From 1638b24cc841cc27f84021e35170bdb4c0790fdb Mon Sep 17 00:00:00 2001 From: Bogdanova Olga Date: Tue, 27 Apr 2021 14:20:36 +0300 Subject: [PATCH] Issues-499: Hide the dropdown options if the 'Edit' option is only available --- .../applications/vanilla/views/discussion/index.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/vanilla/applications/vanilla/views/discussion/index.php b/vanilla/applications/vanilla/views/discussion/index.php index a567548..13c73b2 100644 --- a/vanilla/applications/vanilla/views/discussion/index.php +++ b/vanilla/applications/vanilla/views/discussion/index.php @@ -18,7 +18,16 @@ $this->fireEvent('BeforeDiscussionOptions'); //writeBookmarkLink(); echo bookmarkButton($this->data('Discussion')); -echo getDiscussionOptionsDropdown(); +$dropdown = getDiscussionOptionsDropdown(); +$dropdownOptions = $dropdown->getItems(); +// FIX: https://github.com/topcoder-platform/forums/issues/499 +// Hide the dropdown if there is only the Edit option. The Edit option will be displayed in inline options. +$hasOnlyEditOption = count($dropdownOptions) == 1 && $dropdownOptions['edit']; +if(!$hasOnlyEditOption) { + echo getDiscussionOptionsDropdown(); +} + + writeAdminCheck(); echo '';