Sfoglia il codice sorgente

Merge pull request #653 from aledeg/fix-shortcut

Fix shortcut
Alexandre Alapetite 11 anni fa
parent
commit
0a60a1a71e
2 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 0 2
      p/scripts/main.js
  2. 3 1
      p/scripts/shortcut.js

+ 0 - 2
p/scripts/main.js

@@ -384,8 +384,6 @@ function collapse_entry() {
 }
 
 function user_filter(key) {
-	console.log('user filter');
-	console.warn(key);
 	var filter = $('#dropdown-query');
 	var filters = filter.siblings('.dropdown-menu').find('.item.query a');
 	if (typeof key === "undefined") {

+ 3 - 1
p/scripts/shortcut.js

@@ -43,7 +43,9 @@ shortcut = {
 			//Find Which key is pressed
 			if (e.keyCode) code = e.keyCode;
 			else if (e.which) code = e.which;
-			var character = String.fromCharCode(code).toLowerCase();
+			if(  code == 32 ||  (code >= 48 && code <= 90) ||  (code >= 96 && code <= 111) ||  (code >= 186 && code <= 192) ||  (code >= 219 && code <= 222)) {
+				var character = String.fromCharCode(code).toLowerCase();
+			}
 			
 			if(code == 188) character=","; //If the user presses , when the type is onkeydown
 			if(code == 190) character="."; //If the user presses , when the type is onkeydown