From 1e8b3a1ea6ebd5c49213610a511319f361736e71 Mon Sep 17 00:00:00 2001 From: Mark Salsbery Date: Wed, 21 Jan 2015 11:49:19 -0800 Subject: [PATCH] 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). --- src/viewer.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/viewer.js b/src/viewer.js index 04587719..4ba9ab48 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -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 ){