Skip to content

Commit c29b759

Browse files
authoredApr 27, 2021
Merge pull request #607 from topcoder-platform/issues-604
Issues-499: Hide the dropdown options if the 'Edit' option is only av…
2 parents 83b767b + 1638b24 commit c29b759

File tree

1 file changed

+10
-1
lines changed
  • vanilla/applications/vanilla/views/discussion

1 file changed

+10
-1
lines changed
 

‎vanilla/applications/vanilla/views/discussion/index.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@
1818
$this->fireEvent('BeforeDiscussionOptions');
1919
//writeBookmarkLink();
2020
echo bookmarkButton($this->data('Discussion'));
21-
echo getDiscussionOptionsDropdown();
21+
$dropdown = getDiscussionOptionsDropdown();
22+
$dropdownOptions = $dropdown->getItems();
23+
// FIX: https://github.com/topcoder-platform/forums/issues/499
24+
// Hide the dropdown if there is only the Edit option. The Edit option will be displayed in inline options.
25+
$hasOnlyEditOption = count($dropdownOptions) == 1 && $dropdownOptions['edit'];
26+
if(!$hasOnlyEditOption) {
27+
echo getDiscussionOptionsDropdown();
28+
}
29+
30+
2231
writeAdminCheck();
2332

2433
echo '</div>';

0 commit comments

Comments
 (0)
Please sign in to comment.