FIX: Popup menu not showing for non-staff users.

This commit is contained in:
Guo Xiang Tan 2016-06-17 10:10:05 +08:00
parent fde5ef4902
commit ddfb798276
No known key found for this signature in database
GPG Key ID: 19C321C8952B0F72
3 changed files with 8 additions and 3 deletions

View File

@ -419,7 +419,7 @@ export default Ember.Component.extend({
sendAction: 'showUploadModal'
});
if (this.get("popupMenuOptions").some(option => option.condition)) {
if (this.get("showPopupMenu")) {
toolbar.addButton({
id: 'options',
group: 'extras',

View File

@ -111,6 +111,11 @@ export default Ember.Controller.extend({
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")
popupMenuOptions(composeState) {
if (composeState === 'open') {

View File

@ -1,7 +1,7 @@
{{#if visible}}
<div class='contents'>
{{#if currentUser.staff}}
{{#if showPopupMenu}}
{{#popup-menu visible=optionsVisible hide="hideOptions" title="composer.options"}}
{{#each popupMenuOptions as |option|}}
{{#if option.condition}}
@ -90,7 +90,7 @@
composer=model
lastValidatedAt=lastValidatedAt
canWhisper=canWhisper
popupMenuOptions=popupMenuOptions
showPopupMenu=showPopupMenu
draftStatus=model.draftStatus
isUploading=isUploading
groupsMentioned="groupsMentioned"