Skip to content

Commit 21ef590

Browse files
committed
modal.js: Do not wobble if ESC has been handled otherwise
1 parent 40114d9 commit 21ef590

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

public/js/icinga/behavior/modal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
* @param event {KeyboardEvent} The `keydown` event triggered by pushing a key
209209
*/
210210
Modal.prototype.onEscapeKey = function(event) {
211-
if (event.key !== 'Escape') {
211+
if (event.isDefaultPrevented() || event.key !== 'Escape') {
212212
return;
213213
}
214214

@@ -220,7 +220,7 @@
220220

221221
if (_this.hasChanges) {
222222
_this.wobble($modal);
223-
} else if (! event.isDefaultPrevented()) {
223+
} else {
224224
_this.hide($modal);
225225
}
226226
};

0 commit comments

Comments
 (0)