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

Commit fe461da

Browse files
committed
input fix
1 parent a912e25 commit fe461da

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

docs/index.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ <h1 class="logo"><a href="." class="ss-list">jPanelMenu</a></h1>
4040
</header>
4141

4242
<div class="content">
43+
<section>
44+
<h2 id="form"><a href="#">Sample with inputfields</a></h2>
45+
<form action="">
46+
<input type="text">
47+
<textarea name="" id="" cols="30" rows="10"></textarea>
48+
</form>
49+
</section>
4350
<section class="intro">
4451
<h2 id="overview"><a href="#">Version 1.1</a></h2>
4552
<div class="text">
@@ -549,6 +556,11 @@ <h2 id="about"><a href="#about">Who Made This Wonderful Little Plugin?</a></h2>
549556
550557
-->
551558

552-
<script src="js/script.min.js"></script>
559+
<script src="js/lib/modernizr-2.6.1.min.js"></script>
560+
<script src="js/lib/respond-1.1.0.min.js"></script>
561+
<script src="../jPanelMenu-1.1.0.js"></script>
562+
<script src="js/lib/highlight.min.js"></script>
563+
<script src="js/lib/plugins.js"></script>
564+
<script src="js/script.js"></script>
553565
</body>
554566
</html>

jPanelMenu-1.1.0.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,18 @@
443443
},
444444

445445
initiateKeyboardListeners: function() {
446+
var preventKeyListeners = ['input', 'textarea'];
446447
$(document).on('keydown',function(e){
448+
var $target = $(e.target),
449+
prevent = false;
450+
$.each(preventKeyListeners, function(){
451+
if ($target.is(this.toString())) { // no shurtcuts in form fields
452+
prevent = true;
453+
}
454+
});
455+
if (prevent) {
456+
return true;
457+
}
447458
for ( mapping in jP.options.keyboardShortcuts ) {
448459
if ( e.which == jP.options.keyboardShortcuts[mapping].code )
449460
{

0 commit comments

Comments
 (0)