mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-01-31 03:40:15 -05:00
FIX: Popup menu not showing for non-staff users.
This commit is contained in:
parent
fde5ef4902
commit
ddfb798276
3 changed files with 8 additions and 3 deletions
|
@ -419,7 +419,7 @@ export default Ember.Component.extend({
|
||||||
sendAction: 'showUploadModal'
|
sendAction: 'showUploadModal'
|
||||||
});
|
});
|
||||||
|
|
||||||
if (this.get("popupMenuOptions").some(option => option.condition)) {
|
if (this.get("showPopupMenu")) {
|
||||||
toolbar.addButton({
|
toolbar.addButton({
|
||||||
id: 'options',
|
id: 'options',
|
||||||
group: 'extras',
|
group: 'extras',
|
||||||
|
|
|
@ -111,6 +111,11 @@ export default Ember.Controller.extend({
|
||||||
return currentUser && currentUser.get('staff') && this.siteSettings.enable_whispers && action === Composer.REPLY;
|
return currentUser && currentUser.get('staff') && this.siteSettings.enable_whispers && action === Composer.REPLY;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@computed("popupMenuOptions")
|
||||||
|
showPopupMenu(popupMenuOptions) {
|
||||||
|
return popupMenuOptions.some(option => option.condition);
|
||||||
|
},
|
||||||
|
|
||||||
@computed("model.composeState")
|
@computed("model.composeState")
|
||||||
popupMenuOptions(composeState) {
|
popupMenuOptions(composeState) {
|
||||||
if (composeState === 'open') {
|
if (composeState === 'open') {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{{#if visible}}
|
{{#if visible}}
|
||||||
<div class='contents'>
|
<div class='contents'>
|
||||||
|
|
||||||
{{#if currentUser.staff}}
|
{{#if showPopupMenu}}
|
||||||
{{#popup-menu visible=optionsVisible hide="hideOptions" title="composer.options"}}
|
{{#popup-menu visible=optionsVisible hide="hideOptions" title="composer.options"}}
|
||||||
{{#each popupMenuOptions as |option|}}
|
{{#each popupMenuOptions as |option|}}
|
||||||
{{#if option.condition}}
|
{{#if option.condition}}
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
composer=model
|
composer=model
|
||||||
lastValidatedAt=lastValidatedAt
|
lastValidatedAt=lastValidatedAt
|
||||||
canWhisper=canWhisper
|
canWhisper=canWhisper
|
||||||
popupMenuOptions=popupMenuOptions
|
showPopupMenu=showPopupMenu
|
||||||
draftStatus=model.draftStatus
|
draftStatus=model.draftStatus
|
||||||
isUploading=isUploading
|
isUploading=isUploading
|
||||||
groupsMentioned="groupsMentioned"
|
groupsMentioned="groupsMentioned"
|
||||||
|
|
Loading…
Reference in a new issue