Skip to content

Commit

Permalink
Merge pull request #618 from designitsecure/Issue#71
Browse files Browse the repository at this point in the history
Dialogues closed by pressing the escape key
  • Loading branch information
psiinon authored Oct 28, 2019
2 parents 6f4cfb2 + 92641c1 commit c011500
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Added 'Toggle Script' tool, allowing user-made scripts to be toggled on and off from the HUD [#335](https://github.com/zaproxy/zap-hud/issues/335)

### Fixed
- Dialogue windows close properly when the Escape key is pressed [#71](https://github.com/zaproxy/zap-hud/issues/71)

## [0.7.0] - 2019-10-07

### Changed
Expand Down
11 changes: 11 additions & 0 deletions src/main/zapHomeFiles/hud/display.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,18 @@ Vue.component('modal', {
}

app.keepShowing = false;
},
escapeKey(event) {
if (this.show && (event.key === 'Escape' || event.key === 'Esc')) {
this.close();
}
}
},
mounted() {
document.addEventListener('keydown', this.escapeKey);
},
beforeDestroy() {
document.removeEventListener('keydown', this.escapeKey);
}
});

Expand Down

0 comments on commit c011500

Please sign in to comment.