diff --git a/src/button.js b/src/button.js index 0066efb9..60eb450d 100644 --- a/src/button.js +++ b/src/button.js @@ -137,10 +137,10 @@ $.Button = function( options ) { this.tooltip; this.element.style.position = "relative"; - if ( this.element.style[ "touch-action" ] !== undefined ) { - this.element.style[ "touch-action" ] = "none"; - } else if ( this.element.style[ "-ms-touch-action" ] !== undefined ) { - this.element.style[ "-ms-touch-action" ] = "none"; + 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'; } this.imgGroup.style.position = diff --git a/src/buttongroup.js b/src/buttongroup.js index 51bb5642..977d616a 100644 --- a/src/buttongroup.js +++ b/src/buttongroup.js @@ -80,10 +80,10 @@ $.ButtonGroup = function( options ) { } } - if ( this.element.style[ "touch-action" ] !== undefined ) { - this.element.style[ "touch-action" ] = "none"; - } else if ( this.element.style[ "-ms-touch-action" ] !== undefined ) { - this.element.style[ "-ms-touch-action" ] = "none"; + 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'; } /** diff --git a/src/navigator.js b/src/navigator.js index a3fda4f5..410f99b8 100644 --- a/src/navigator.js +++ b/src/navigator.js @@ -112,10 +112,10 @@ $.Navigator = function( options ){ options.minPixelRatio = this.minPixelRatio = viewer.minPixelRatio; - if ( this.element.style[ "touch-action" ] !== undefined ) { - this.element.style[ "touch-action" ] = "none"; - } else if ( this.element.style[ "-ms-touch-action" ] !== undefined ) { - this.element.style[ "-ms-touch-action" ] = "none"; + 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'; } this.borderWidth = 2; diff --git a/src/referencestrip.js b/src/referencestrip.js index c344c880..6a70c634 100644 --- a/src/referencestrip.js +++ b/src/referencestrip.js @@ -114,10 +114,10 @@ $.ReferenceStrip = function ( options ) { style.background = '#000'; style.position = 'relative'; - if ( this.element.style[ "touch-action" ] !== undefined ) { - this.element.style[ "touch-action" ] = "none"; - } else if ( this.element.style[ "-ms-touch-action" ] !== undefined ) { - this.element.style[ "-ms-touch-action" ] = "none"; + 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'; } $.setElementOpacity( this.element, 0.8 ); @@ -195,10 +195,10 @@ $.ReferenceStrip = function ( options ) { element.style.cssFloat = 'left'; //Firefox element.style.styleFloat = 'left'; //IE element.style.padding = '2px'; - if ( element.style[ "touch-action" ] !== undefined ) { - element.style[ "touch-action" ] = "none"; - } else if ( element.style[ "-ms-touch-action" ] !== undefined ) { - element.style[ "-ms-touch-action" ] = "none"; + if ( typeof element.style.touchAction !== 'undefined' ) { + element.style.touchAction = 'none'; + } else if ( typeof element.style.msTouchAction !== 'undefined' ) { + element.style.msTouchAction = 'none'; } element.innerTracker = new $.MouseTracker( { diff --git a/src/viewer.js b/src/viewer.js index 3575db9e..6558480b 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -276,10 +276,10 @@ $.Viewer = function( options ) { style.top = "0px"; style.left = "0px"; // Disable browser default touch handling - if ( style[ "touch-action" ] !== undefined ) { - style[ "touch-action" ] = "none"; - } else if ( style["-ms-touch-action"] !== undefined ) { - style[ "-ms-touch-action" ] = "none"; + if ( typeof style.touchAction !== 'undefined' ) { + style.touchAction = 'none'; + } else if ( typeof style.msTouchAction !== 'undefined' ) { + style.msTouchAction = 'none'; } }(this.canvas.style));