Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Commit 81520de

Browse files
committed
Can now configure if the cheat sheet hotkey is allowed in input, select and textarea controls.
1 parent 878e2b3 commit 81520de

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-hotkeys",
33
"author": "Wes Cruver",
4-
"version": "1.7.1",
4+
"version": "1.8.0",
55
"license": "MIT",
66
"description": "Automatic keyboard shortcuts for your Angular Apps",
77
"homepage": "https://chieffancypants.github.io/angular-hotkeys",

src/hotkeys.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@
6565
*/
6666
this.cheatSheetHotkey = '?';
6767

68+
/**
69+
* Configurable setting for allowing the cheat sheet hotkey in certain nodes like 'INPUT', 'SELECT' and 'TEXTAREA'.
70+
* @type {Array} Array of strings
71+
*/
72+
this.cheatSheetAllowIn = null;
73+
6874
/**
6975
* Configurable setting for the cheat sheet description
7076
* @type {String}
@@ -263,7 +269,7 @@
263269
var document = $document[0];
264270
var element = $rootElement[0];
265271
var helpMenu = angular.element(this.template);
266-
_add(this.cheatSheetHotkey, this.cheatSheetDescription, toggleCheatSheet);
272+
_add(this.cheatSheetHotkey, this.cheatSheetDescription, toggleCheatSheet, null, this.cheatSheetAllowIn);
267273

268274
// If $rootElement is document or documentElement, then body must be used
269275
if (element === document || element === document.documentElement) {
@@ -582,6 +588,7 @@
582588
toggleCheatSheet : toggleCheatSheet,
583589
includeCheatSheet : this.includeCheatSheet,
584590
cheatSheetHotkey : this.cheatSheetHotkey,
591+
cheatSheetAllowIn : this.cheatSheetAllowIn,
585592
cheatSheetDescription : this.cheatSheetDescription,
586593
useNgRoute : this.useNgRoute,
587594
purgeHotkeys : purgeHotkeys,

0 commit comments

Comments
 (0)