Skip to content

Commit

Permalink
Add more filters for trapping keystrokes
Browse files Browse the repository at this point in the history
  • Loading branch information
terrill committed Sep 21, 2018
1 parent a88a856 commit 7f34bb5
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 9 deletions.
7 changes: 6 additions & 1 deletion build/ableplayer.dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -10558,7 +10558,12 @@
}

// Only use keypress to control player if focus is NOT on an input field or contenteditable element
if (!($(':focus').is('[contenteditable]') || ($(':focus').is('input')))) {
if (!(
$(':focus').is('[contenteditable]') ||
$(':focus').is('input') ||
e.target.hasAttribute('contenteditable') ||
e.target.tagName === 'INPUT'
)){
if (which === 27) { // escape
this.closePopups();
}
Expand Down
7 changes: 6 additions & 1 deletion build/ableplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10558,7 +10558,12 @@
}

// Only use keypress to control player if focus is NOT on an input field or contenteditable element
if (!($(':focus').is('[contenteditable]') || ($(':focus').is('input')))) {
if (!(
$(':focus').is('[contenteditable]') ||
$(':focus').is('input') ||
e.target.hasAttribute('contenteditable') ||
e.target.tagName === 'INPUT'
)){
if (which === 27) { // escape
this.closePopups();
}
Expand Down
2 changes: 1 addition & 1 deletion build/ableplayer.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions build/ableplayer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ableplayer",
"version": "3.1.12",
"version": "3.1.13",
"description": "fully accessible HTML5 media player",
"homepage": "http://ableplayer.github.io/ableplayer",
"bugs": "https://github.com/ableplayer/ableplayer/issues",
Expand Down
7 changes: 6 additions & 1 deletion scripts/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,12 @@
}

// Only use keypress to control player if focus is NOT on an input field or contenteditable element
if (!($(':focus').is('[contenteditable]') || ($(':focus').is('input')))) {
if (!(
$(':focus').is('[contenteditable]') ||
$(':focus').is('input') ||
e.target.hasAttribute('contenteditable') ||
e.target.tagName === 'INPUT'
)){
if (which === 27) { // escape
this.closePopups();
}
Expand Down

0 comments on commit 7f34bb5

Please sign in to comment.