Removed Viewer focusHandler/onCanvasFocus

Presumably, this was meant to manually scroll the viewer into view when it receives focus. This is already handled by browsers when tabbing to the viewer, so doing it explicitly isn't necessary, and it creates a negative user experience when clicking on a viewer to give it focus (as of #569).
This commit is contained in:
Mark Salsbery 2015-01-21 11:49:19 -08:00
parent e966f3eafb
commit 1e8b3a1ea6

View File

@ -301,7 +301,6 @@ $.Viewer = function( options ) {
clickDistThreshold: this.clickDistThreshold,
dblClickTimeThreshold: this.dblClickTimeThreshold,
dblClickDistThreshold: this.dblClickDistThreshold,
focusHandler: $.delegate( this, onCanvasFocus ),
keyDownHandler: $.delegate( this, onCanvasKeyDown ),
keyHandler: $.delegate( this, onCanvasKeyPress ),
clickHandler: $.delegate( this, onCanvasClick ),
@ -2188,13 +2187,6 @@ function onBlur(){
}
function onCanvasFocus( event ) {
if ( !event.preventDefaultAction ) {
var point = $.getElementPosition( this.element );
window.scrollTo( 0, point.y );
}
}
function onCanvasKeyDown( event ) {
if ( !event.preventDefaultAction && !event.ctrl && !event.alt && !event.meta ) {
switch( event.keyCode ){