Add support for enter/shift for find.
This commit is contained in:
		
							parent
							
								
									3bd20a7415
								
							
						
					
					
						commit
						45fe76e752
					
				@ -480,9 +480,17 @@ var PDFFindBar = {
 | 
				
			|||||||
      self.dispatchEvent('');
 | 
					      self.dispatchEvent('');
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // TODO: Add keybindings like enter, shift-enter, CMD-G etc. to go to prev/
 | 
					    // TODO: Add keybindings CMD-G etc. to go to prev/
 | 
				
			||||||
    // next match when the findField is selected.
 | 
					    // next match when the findField is selected.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    this.findField.addEventListener('keydown', function(evt) {
 | 
				
			||||||
 | 
					      switch (evt.keyCode) {
 | 
				
			||||||
 | 
					        case 13: // Enter
 | 
				
			||||||
 | 
					          self.dispatchEvent('again', evt.shiftKey);
 | 
				
			||||||
 | 
					          break;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    document.getElementById('findPrevious').addEventListener('click',
 | 
					    document.getElementById('findPrevious').addEventListener('click',
 | 
				
			||||||
      function() { self.dispatchEvent('again', true); }
 | 
					      function() { self.dispatchEvent('again', true); }
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user