Allow arrow keys in input fields and textareas
If you pressed an arrow key in a textarea before, the next/previous media was opened.
This commit is contained in:
parent
32d8cf4511
commit
e8be1d7af5
@ -29,7 +29,7 @@ body {
|
|||||||
background-color: #111;
|
background-color: #111;
|
||||||
background-image: url("../images/background.png");
|
background-image: url("../images/background.png");
|
||||||
color: #C3C3C3;
|
color: #C3C3C3;
|
||||||
padding: none;
|
padding: 0;
|
||||||
margin: 0px;
|
margin: 0px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
font: 16px 'Lato', 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif;
|
font: 16px 'Lato', 'Helvetica Neue', Arial, 'Liberation Sans', FreeSans, sans-serif;
|
||||||
|
@ -16,6 +16,15 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* It must be wrapped into a function and you also cannot use
|
||||||
|
* $(':not(textarea, input)') because of some reason. */
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('textarea, input').keydown(function(event){
|
||||||
|
event.stopPropagation();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$(document).keydown(function(event){
|
$(document).keydown(function(event){
|
||||||
switch(event.which){
|
switch(event.which){
|
||||||
case 37:
|
case 37:
|
||||||
@ -30,4 +39,3 @@ $(document).keydown(function(event){
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user