mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-21 20:56:09 +03:00
Re-added the OpenSeadragon.setElementPointerEventsNone() function
This commit is contained in:
parent
72fc528b3c
commit
40623f1e99
@ -50,6 +50,7 @@ OPENSEADRAGON CHANGELOG
|
|||||||
* Fixed a bug where the ajaxHeaders provided per-image were not being used for image requests (#1968 @maxshuty)
|
* Fixed a bug where the ajaxHeaders provided per-image were not being used for image requests (#1968 @maxshuty)
|
||||||
* MouseTracker: Added workaround for WebKit Pointer Event Implicit Capture Bug (#1972 @msalsbery)
|
* MouseTracker: Added workaround for WebKit Pointer Event Implicit Capture Bug (#1972 @msalsbery)
|
||||||
* Removed test for move-leave (fly-over, no enter event)...not a valid, handleable event state, no longer supported (#1972 @msalsbery)
|
* Removed test for move-leave (fly-over, no enter event)...not a valid, handleable event state, no longer supported (#1972 @msalsbery)
|
||||||
|
* Added OpenSeadragon.setElementPointerEvents() for setting pointer-events to other values besides 'none' on DOM elements (#1972 @msalsbery)
|
||||||
|
|
||||||
2.4.2:
|
2.4.2:
|
||||||
|
|
||||||
|
@ -140,10 +140,10 @@ $.Button = function( options ) {
|
|||||||
|
|
||||||
// Allow pointer events to pass through the img elements so implicit
|
// Allow pointer events to pass through the img elements so implicit
|
||||||
// pointer capture works on touch devices
|
// pointer capture works on touch devices
|
||||||
$.setElementPointerEvents( this.imgRest, 'none' );
|
$.setElementPointerEventsNone( this.imgRest );
|
||||||
$.setElementPointerEvents( this.imgGroup, 'none' );
|
$.setElementPointerEventsNone( this.imgGroup );
|
||||||
$.setElementPointerEvents( this.imgHover, 'none' );
|
$.setElementPointerEventsNone( this.imgHover );
|
||||||
$.setElementPointerEvents( this.imgDown, 'none' );
|
$.setElementPointerEventsNone( this.imgDown );
|
||||||
|
|
||||||
this.element.style.position = "relative";
|
this.element.style.position = "relative";
|
||||||
$.setElementTouchActionNone( this.element );
|
$.setElementTouchActionNone( this.element );
|
||||||
|
@ -128,7 +128,7 @@ $.Drawer = function( options ) {
|
|||||||
$.setElementOpacity( this.canvas, this.opacity, true );
|
$.setElementOpacity( this.canvas, this.opacity, true );
|
||||||
// Allow pointer events to pass through the canvas element so implicit
|
// Allow pointer events to pass through the canvas element so implicit
|
||||||
// pointer capture works on touch devices
|
// pointer capture works on touch devices
|
||||||
$.setElementPointerEvents( this.canvas, 'none' );
|
$.setElementPointerEventsNone( this.canvas );
|
||||||
$.setElementTouchActionNone( this.canvas );
|
$.setElementTouchActionNone( this.canvas );
|
||||||
|
|
||||||
// explicit left-align
|
// explicit left-align
|
||||||
|
@ -167,7 +167,7 @@ $.Navigator = function( options ){
|
|||||||
style.zIndex = 999999999;
|
style.zIndex = 999999999;
|
||||||
style.cursor = 'default';
|
style.cursor = 'default';
|
||||||
}( this.displayRegion.style, this.borderWidth ));
|
}( this.displayRegion.style, this.borderWidth ));
|
||||||
$.setElementPointerEvents( this.displayRegion, 'none' );
|
$.setElementPointerEventsNone( this.displayRegion );
|
||||||
$.setElementTouchActionNone( this.displayRegion );
|
$.setElementTouchActionNone( this.displayRegion );
|
||||||
|
|
||||||
this.displayRegionContainer = $.makeNeutralElement("div");
|
this.displayRegionContainer = $.makeNeutralElement("div");
|
||||||
@ -175,7 +175,7 @@ $.Navigator = function( options ){
|
|||||||
this.displayRegionContainer.className = "displayregioncontainer";
|
this.displayRegionContainer.className = "displayregioncontainer";
|
||||||
this.displayRegionContainer.style.width = "100%";
|
this.displayRegionContainer.style.width = "100%";
|
||||||
this.displayRegionContainer.style.height = "100%";
|
this.displayRegionContainer.style.height = "100%";
|
||||||
$.setElementPointerEvents( this.displayRegionContainer, 'none' );
|
$.setElementPointerEventsNone( this.displayRegionContainer );
|
||||||
$.setElementTouchActionNone( this.displayRegionContainer );
|
$.setElementTouchActionNone( this.displayRegionContainer );
|
||||||
|
|
||||||
viewer.addControl(
|
viewer.addControl(
|
||||||
@ -246,8 +246,8 @@ $.Navigator = function( options ){
|
|||||||
// pointer capture works on touch devices
|
// pointer capture works on touch devices
|
||||||
//TODO an alternative is to attach the new MouseTracker to this.canvas...not
|
//TODO an alternative is to attach the new MouseTracker to this.canvas...not
|
||||||
// sure why it isn't already (see MouseTracker constructor call above)
|
// sure why it isn't already (see MouseTracker constructor call above)
|
||||||
$.setElementPointerEvents( this.canvas, 'none' );
|
$.setElementPointerEventsNone( this.canvas );
|
||||||
$.setElementPointerEvents( this.container, 'none' );
|
$.setElementPointerEventsNone( this.container );
|
||||||
|
|
||||||
this.addHandler("reset-size", function() {
|
this.addHandler("reset-size", function() {
|
||||||
if (_this.viewport) {
|
if (_this.viewport) {
|
||||||
|
@ -1924,6 +1924,16 @@ function OpenSeadragon( options ){
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the specified element's pointer-events style attribute to 'none'.
|
||||||
|
* @function
|
||||||
|
* @param {Element|String} element
|
||||||
|
*/
|
||||||
|
setElementPointerEventsNone: function( element ) {
|
||||||
|
$.setElementPointerEvents( element, 'none' );
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the specified CSS class to the element if not present.
|
* Add the specified CSS class to the element if not present.
|
||||||
* @function
|
* @function
|
||||||
|
@ -196,7 +196,7 @@ $.ReferenceStrip = function ( options ) {
|
|||||||
element.style.styleFloat = 'left'; //IE
|
element.style.styleFloat = 'left'; //IE
|
||||||
element.style.padding = '2px';
|
element.style.padding = '2px';
|
||||||
$.setElementTouchActionNone( element );
|
$.setElementTouchActionNone( element );
|
||||||
$.setElementPointerEvents( element, 'none' );
|
$.setElementPointerEventsNone( element );
|
||||||
|
|
||||||
this.element.appendChild( element );
|
this.element.appendChild( element );
|
||||||
|
|
||||||
@ -458,8 +458,8 @@ function loadPanels( strip, viewerSize, scroll ) {
|
|||||||
} );
|
} );
|
||||||
// Allow pointer events to pass through miniViewer's canvas/container
|
// Allow pointer events to pass through miniViewer's canvas/container
|
||||||
// elements so implicit pointer capture works on touch devices
|
// elements so implicit pointer capture works on touch devices
|
||||||
$.setElementPointerEvents( miniViewer.canvas, 'none' );
|
$.setElementPointerEventsNone( miniViewer.canvas );
|
||||||
$.setElementPointerEvents( miniViewer.container, 'none' );
|
$.setElementPointerEventsNone( miniViewer.container );
|
||||||
// We'll use event delegation from the reference strip element instead of
|
// We'll use event delegation from the reference strip element instead of
|
||||||
// handling events on every miniViewer
|
// handling events on every miniViewer
|
||||||
miniViewer.innerTracker.setTracking( false );
|
miniViewer.innerTracker.setTracking( false );
|
||||||
|
@ -408,7 +408,7 @@ $.Viewer = function( options ) {
|
|||||||
|
|
||||||
// Overlay container
|
// Overlay container
|
||||||
this.overlaysContainer = $.makeNeutralElement( "div" );
|
this.overlaysContainer = $.makeNeutralElement( "div" );
|
||||||
$.setElementPointerEvents( this.overlaysContainer, 'none' );
|
$.setElementPointerEventsNone( this.overlaysContainer );
|
||||||
$.setElementTouchActionNone( this.overlaysContainer );
|
$.setElementTouchActionNone( this.overlaysContainer );
|
||||||
this.canvas.appendChild( this.overlaysContainer );
|
this.canvas.appendChild( this.overlaysContainer );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user