mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 05:06:09 +03:00
Added $.setElementTouchActionNone function
This commit is contained in:
parent
be13d25a26
commit
e9b7634499
@ -137,11 +137,7 @@ $.Button = function( options ) {
|
||||
this.tooltip;
|
||||
|
||||
this.element.style.position = "relative";
|
||||
if ( typeof this.element.style.touchAction !== 'undefined' ) {
|
||||
this.element.style.touchAction = 'none';
|
||||
} else if ( typeof this.element.style.msTouchAction !== 'undefined' ) {
|
||||
this.element.style.msTouchAction = 'none';
|
||||
}
|
||||
$.setElementTouchActionNone( this.element );
|
||||
|
||||
this.imgGroup.style.position =
|
||||
this.imgHover.style.position =
|
||||
|
@ -80,11 +80,7 @@ $.ButtonGroup = function( options ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( typeof this.element.style.touchAction !== 'undefined' ) {
|
||||
this.element.style.touchAction = 'none';
|
||||
} else if ( typeof this.element.style.msTouchAction !== 'undefined' ) {
|
||||
this.element.style.msTouchAction = 'none';
|
||||
}
|
||||
$.setElementTouchActionNone( this.element );
|
||||
|
||||
/**
|
||||
* Tracks mouse/touch/key events accross the group of buttons.
|
||||
|
@ -112,11 +112,7 @@ $.Navigator = function( options ){
|
||||
|
||||
options.minPixelRatio = this.minPixelRatio = viewer.minPixelRatio;
|
||||
|
||||
if ( typeof this.element.style.touchAction !== 'undefined' ) {
|
||||
this.element.style.touchAction = 'none';
|
||||
} else if ( typeof this.element.style.msTouchAction !== 'undefined' ) {
|
||||
this.element.style.msTouchAction = 'none';
|
||||
}
|
||||
$.setElementTouchActionNone( this.element );
|
||||
|
||||
this.borderWidth = 2;
|
||||
//At some browser magnification levels the display regions lines up correctly, but at some there appears to
|
||||
|
@ -1585,6 +1585,21 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Sets the specified element's touch-action style attribute to 'none'.
|
||||
* @function
|
||||
* @param {Element|String} element
|
||||
*/
|
||||
setElementTouchActionNone: function( element ) {
|
||||
element = $.getElement( element );
|
||||
if ( typeof element.style.touchAction !== 'undefined' ) {
|
||||
element.style.touchAction = 'none';
|
||||
} else if ( typeof element.style.msTouchAction !== 'undefined' ) {
|
||||
element.style.msTouchAction = 'none';
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Add the specified CSS class to the element if not present.
|
||||
* @function
|
||||
|
@ -114,11 +114,7 @@ $.ReferenceStrip = function ( options ) {
|
||||
style.background = '#000';
|
||||
style.position = 'relative';
|
||||
|
||||
if ( typeof this.element.style.touchAction !== 'undefined' ) {
|
||||
this.element.style.touchAction = 'none';
|
||||
} else if ( typeof this.element.style.msTouchAction !== 'undefined' ) {
|
||||
this.element.style.msTouchAction = 'none';
|
||||
}
|
||||
$.setElementTouchActionNone( this.element );
|
||||
|
||||
$.setElementOpacity( this.element, 0.8 );
|
||||
|
||||
@ -195,11 +191,7 @@ $.ReferenceStrip = function ( options ) {
|
||||
element.style.cssFloat = 'left'; //Firefox
|
||||
element.style.styleFloat = 'left'; //IE
|
||||
element.style.padding = '2px';
|
||||
if ( typeof element.style.touchAction !== 'undefined' ) {
|
||||
element.style.touchAction = 'none';
|
||||
} else if ( typeof element.style.msTouchAction !== 'undefined' ) {
|
||||
element.style.msTouchAction = 'none';
|
||||
}
|
||||
$.setElementTouchActionNone( element );
|
||||
|
||||
element.innerTracker = new $.MouseTracker( {
|
||||
element: element,
|
||||
|
@ -275,13 +275,8 @@ $.Viewer = function( options ) {
|
||||
style.position = "absolute";
|
||||
style.top = "0px";
|
||||
style.left = "0px";
|
||||
// Disable browser default touch handling
|
||||
if ( typeof style.touchAction !== 'undefined' ) {
|
||||
style.touchAction = 'none';
|
||||
} else if ( typeof style.msTouchAction !== 'undefined' ) {
|
||||
style.msTouchAction = 'none';
|
||||
}
|
||||
}(this.canvas.style));
|
||||
$.setElementTouchActionNone( this.canvas );
|
||||
|
||||
//the container is created through applying the ControlDock constructor above
|
||||
this.container.className = "openseadragon-container";
|
||||
|
Loading…
Reference in New Issue
Block a user