FIX: Don't dismiss headers on modifier keys.

This commit is contained in:
Guo Xiang Tan 2015-09-17 00:38:05 +08:00
parent afdb15f99f
commit 685471303a
2 changed files with 4 additions and 1 deletions

View File

@ -155,7 +155,7 @@ export default Ember.Component.extend({
@on('didInsertElement')
_bindEvents() {
this.$().on('click.discourse-menu-panel', 'a', e => {
if (e.metaKey) { return; }
if (e.metaKey || e.ctrlKey || e.shiftKey) { return; }
if ($(e.target).data('ember-action')) { return; }
this.hide();
});

View File

@ -0,0 +1,3 @@
export function isModifierOrMetaKey(event) {
return e.metaKey || e.ctrlKey || e.shiftKey;
}