mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-26 07:06:10 +03:00
fix #500 - requests keyboard focus when canvas is clicked
The canvas click listener will now check if keyboard-command-area has focus, and if it does not, it will request it.
This commit is contained in:
parent
37016e468c
commit
69e9326d4f
@ -2265,6 +2265,13 @@ function onBlur(){
|
|||||||
function onCanvasClick( event ) {
|
function onCanvasClick( event ) {
|
||||||
var gestureSettings;
|
var gestureSettings;
|
||||||
|
|
||||||
|
var haveKeyboardFocus = document.activeElement == this.keyboardCommandArea;
|
||||||
|
|
||||||
|
// If we don't have keyboard focus, request it.
|
||||||
|
if ( !haveKeyboardFocus ) {
|
||||||
|
this.keyboardCommandArea.focus();
|
||||||
|
}
|
||||||
|
|
||||||
if ( !event.preventDefaultAction && this.viewport && event.quick ) {
|
if ( !event.preventDefaultAction && this.viewport && event.quick ) {
|
||||||
gestureSettings = this.gestureSettingsByDeviceType( event.pointerType );
|
gestureSettings = this.gestureSettingsByDeviceType( event.pointerType );
|
||||||
if ( gestureSettings.clickToZoom ) {
|
if ( gestureSettings.clickToZoom ) {
|
||||||
|
Loading…
Reference in New Issue
Block a user