diff options
Diffstat (limited to 'client/components/forms/inlinedform.js')
-rw-r--r-- | client/components/forms/inlinedform.js | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/client/components/forms/inlinedform.js b/client/components/forms/inlinedform.js index e4331892..2988738c 100644 --- a/client/components/forms/inlinedform.js +++ b/client/components/forms/inlinedform.js @@ -36,7 +36,7 @@ BlazeComponent.extendComponent({ open: function() { // Close currently opened form, if any - EscapeActions.executeLowerThan('inlinedForm'); + EscapeActions.executeUpTo('inlinedForm'); this.isOpen.set(true); currentlyOpenedForm.set(this); }, @@ -61,18 +61,6 @@ BlazeComponent.extendComponent({ 'click .js-close-inlined-form': this.close, 'click .js-open-inlined-form': this.open, - // Close the inlined form by pressing escape. - // - // Keydown (and not keypress) in necessary here because the `keyCode` - // property is consistent in all browsers, (there is not keyCode for the - // `keypress` event in firefox) - 'keydown form input, keydown form textarea': function(evt) { - if (evt.keyCode === 27) { - evt.preventDefault(); - EscapeActions.executeLowest(); - } - }, - // Pressing Ctrl+Enter should submit the form 'keydown form textarea': function(evt) { if (evt.keyCode === 13 && (evt.metaKey || evt.ctrlKey)) { @@ -98,5 +86,7 @@ BlazeComponent.extendComponent({ // Press escape to close the currently opened inlinedForm EscapeActions.register('inlinedForm', function() { currentlyOpenedForm.get().close(); }, - function() { return currentlyOpenedForm.get() !== null; } + function() { return currentlyOpenedForm.get() !== null; }, { + noClickEscapeOn: '.js-inlined-form' + } ); |