disable input "keydown" on smartphones - it's redundant there (no tab key), breaks input editing, and has some impact on performance
fix #138
This commit is contained in:
		
							
								
								
									
										30
									
								
								code/chat.js
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								code/chat.js
									
									
									
									
									
								
							@@ -606,21 +606,23 @@ window.chat.setupTime = function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
window.chat.setupPosting = function() {
 | 
					window.chat.setupPosting = function() {
 | 
				
			||||||
  $('#chatinput input').keydown(function(event) {
 | 
					  if (!isSmartphone()) {
 | 
				
			||||||
    try {
 | 
					    $('#chatinput input').keydown(function(event) {
 | 
				
			||||||
      var kc = (event.keyCode ? event.keyCode : event.which);
 | 
					      try {
 | 
				
			||||||
      if(kc === 13) { // enter
 | 
					        var kc = (event.keyCode ? event.keyCode : event.which);
 | 
				
			||||||
        chat.postMsg();
 | 
					        if(kc === 13) { // enter
 | 
				
			||||||
        event.preventDefault();
 | 
					          chat.postMsg();
 | 
				
			||||||
      } else if (kc === 9) { // tab
 | 
					          event.preventDefault();
 | 
				
			||||||
        event.preventDefault();
 | 
					        } else if (kc === 9) { // tab
 | 
				
			||||||
        window.chat.handleTabCompletion();
 | 
					          event.preventDefault();
 | 
				
			||||||
 | 
					          window.chat.handleTabCompletion();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      } catch(error) {
 | 
				
			||||||
 | 
					        console.log(error);
 | 
				
			||||||
 | 
					        debug.printStackTrace();
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    } catch(error) {
 | 
					    });
 | 
				
			||||||
      console.log(error);
 | 
					  }
 | 
				
			||||||
      debug.printStackTrace();
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  $('#chatinput').submit(function(event) {
 | 
					  $('#chatinput').submit(function(event) {
 | 
				
			||||||
    event.preventDefault();
 | 
					    event.preventDefault();
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user