Skip to content
This repository has been archived by the owner on Feb 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #11 from stoeffel/master
Browse files Browse the repository at this point in the history
Shortcuts in inputfield
  • Loading branch information
acolangelo committed Feb 3, 2013
2 parents a912e25 + fe461da commit 71652d1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ <h1 class="logo"><a href="." class="ss-list">jPanelMenu</a></h1>
</header>

<div class="content">
<section>
<h2 id="form"><a href="#">Sample with inputfields</a></h2>
<form action="">
<input type="text">
<textarea name="" id="" cols="30" rows="10"></textarea>
</form>
</section>
<section class="intro">
<h2 id="overview"><a href="#">Version 1.1</a></h2>
<div class="text">
Expand Down Expand Up @@ -549,6 +556,11 @@ <h2 id="about"><a href="#about">Who Made This Wonderful Little Plugin?</a></h2>
-->

<script src="js/script.min.js"></script>
<script src="js/lib/modernizr-2.6.1.min.js"></script>
<script src="js/lib/respond-1.1.0.min.js"></script>
<script src="../jPanelMenu-1.1.0.js"></script>
<script src="js/lib/highlight.min.js"></script>
<script src="js/lib/plugins.js"></script>
<script src="js/script.js"></script>
</body>
</html>
11 changes: 11 additions & 0 deletions jPanelMenu-1.1.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,18 @@
},

initiateKeyboardListeners: function() {
var preventKeyListeners = ['input', 'textarea'];
$(document).on('keydown',function(e){
var $target = $(e.target),
prevent = false;
$.each(preventKeyListeners, function(){
if ($target.is(this.toString())) { // no shurtcuts in form fields
prevent = true;
}
});
if (prevent) {
return true;
}
for ( mapping in jP.options.keyboardShortcuts ) {
if ( e.which == jP.options.keyboardShortcuts[mapping].code )
{
Expand Down

0 comments on commit 71652d1

Please sign in to comment.