Skip to content
This repository has been archived by the owner on Nov 8, 2017. It is now read-only.

Skip keyCode check in is() when keyCode does not exist on event object #62

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions jwerty.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@
// For each property in the jwertyCode object, compare to `event`
for (var p in jwertyCode[n]) {
// ...except for jwertyCode.jwertyCombo...
if (p !== 'jwertyCombo' && event[p] != jwertyCode[n][p]) returnValue = false;
if (p !== 'jwertyCombo' && event[p] !== undefined && event[p] != jwertyCode[n][p]) returnValue = false;
}
// If this jwertyCode optional wasn't falsey, then we can return early.
if (returnValue !== false) return returnValue;
Expand Down Expand Up @@ -537,4 +537,4 @@
KEYS: _keys
};

}(typeof global !== 'undefined' && global.window || this, (typeof module !== 'undefined' && module.exports ? module.exports : this)));
}(typeof global !== 'undefined' && global.window || this, (typeof module !== 'undefined' && module.exports ? module.exports : this)));