mirror of
https://github.com/evennia/evennia.git
synced 2026-04-04 23:17:17 +02:00
Fixed a firefox-incompatability bug in the webclient. Resolves issue143.
This commit is contained in:
parent
de28b2d575
commit
8288534cf6
2 changed files with 11 additions and 5 deletions
|
|
@ -192,7 +192,8 @@ function history_add(input) {
|
|||
// Catching keyboard shortcuts
|
||||
|
||||
$(document).keypress( function(event) {
|
||||
var code = event.keyCode ? event.keyCode : event.which;
|
||||
var code = event.keyCode ? event.keyCode : event.which;
|
||||
wresult = event.which;
|
||||
|
||||
// always focus input field
|
||||
$("#inputfield")[0].focus();
|
||||
|
|
@ -202,12 +203,17 @@ $(document).keypress( function(event) {
|
|||
return false;
|
||||
}
|
||||
else {
|
||||
if (code == 38) { // arrow up
|
||||
$("#inputfield").val(function(index, value){
|
||||
if (wresult == 38 || wresult == 40) {
|
||||
// this fixes a bug in firefox, those are on ASCII format
|
||||
return false;
|
||||
}
|
||||
|
||||
if (code == 38) { // arrow up 38
|
||||
$("#inputfield").val(function(index, value){
|
||||
return history_step_back();
|
||||
});
|
||||
}
|
||||
else if (code == 40) { // arrow down
|
||||
else if (code == 40) { // arrow down 40
|
||||
$("#inputfield").val(function(index, value){
|
||||
return history_step_fwd();
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue