FIX: Clicking on gear icon should hide popup menu.

This commit is contained in:
Guo Xiang Tan 2016-07-11 10:54:19 +08:00
parent 6e385f11b3
commit 4b557842eb
3 changed files with 34 additions and 28 deletions

View File

@ -366,7 +366,10 @@ export default Ember.Component.extend({
this._resetUpload(true);
},
showOptions(toolbarEvent) {
toggleOptions(toolbarEvent) {
if (this.get('optionsVisible')) {
this.sendAction('hideOptions');
} else {
// long term we want some smart positioning algorithm in popup-menu
// the problem is that positioning in a fixed panel is a nightmare
// cause offsetParent can end up returning a fixed element and then
@ -397,6 +400,7 @@ export default Ember.Component.extend({
this.sendAction('showOptions', toolbarEvent,
{ position: "absolute", left, top });
}
},
showUploadModal(toolbarEvent) {
@ -432,7 +436,7 @@ export default Ember.Component.extend({
group: 'extras',
icon: 'gear',
title: 'composer.options',
sendAction: 'showOptions'
sendAction: 'toggleOptions'
});
}

View File

@ -5,7 +5,7 @@
markdownOptions=markdownOptions
extraButtons="extraButtons"
importQuote="importQuote"
showOptions="showOptions"
toggleOptions="toggleOptions"
showUploadModal="showUploadModal"
togglePreview="togglePreview"
validation=validation

View File

@ -90,6 +90,8 @@
groupsMentioned="groupsMentioned"
importQuote="importQuote"
showOptions="showOptions"
hideOptions="hideOptions"
optionsVisible=optionsVisible
showToolbar=showToolbar
showUploadSelector="showUploadSelector"
afterRefresh="afterRefresh"}}