mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-01 07:31:41 +03:00
MouseTracker Original Events in handlers
Comment & Formatting fixes
This commit is contained in:
parent
b3fa8f1184
commit
56f5b9fb74
@ -184,9 +184,8 @@ $.Button = function( options ) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// TODO: This didn't match handler signature in MouseTracker. Investigate!
|
focusHandler: function ( tracker, eventData ) {
|
||||||
focusHandler: function ( tracker, eventData ) { //position, buttonDownElement, buttonDownAny
|
this.enterHandler( tracker, eventData );
|
||||||
//this.enterHandler( tracker, eventData ); //position, buttonDownElement, buttonDownAny
|
|
||||||
_this.raiseEvent( "onFocus", _this );
|
_this.raiseEvent( "onFocus", _this );
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -197,9 +196,8 @@ $.Button = function( options ) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// TODO: This didn't match handler signature in MouseTracker. Investigate!
|
blurHandler: function ( tracker, eventData ) {
|
||||||
blurHandler: function ( tracker, eventData ) { //position, buttonDownElement, buttonDownAny
|
this.exitHandler( tracker, eventData );
|
||||||
//this.exitHandler( tracker, eventData ); //position, buttonDownElement, buttonDownAny
|
|
||||||
_this.raiseEvent( "onBlur", _this );
|
_this.raiseEvent( "onBlur", _this );
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -705,7 +705,6 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
|||||||
* @name OpenSeadragon.getElementOffset
|
* @name OpenSeadragon.getElementOffset
|
||||||
* @param {Element|String} element - the element we want the position for.
|
* @param {Element|String} element - the element we want the position for.
|
||||||
* @returns {Point} - the position of the upper left corner of the element adjusted for current page and/or element scroll.
|
* @returns {Point} - the position of the upper left corner of the element adjusted for current page and/or element scroll.
|
||||||
* Inspired by jQuery.fn.offset() (jquery 1.10.1)
|
|
||||||
*/
|
*/
|
||||||
getElementOffset: function( element ) {
|
getElementOffset: function( element ) {
|
||||||
var doc = element && element.ownerDocument,
|
var doc = element && element.ownerDocument,
|
||||||
@ -719,11 +718,6 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
|
|||||||
|
|
||||||
docElement = doc.documentElement;
|
docElement = doc.documentElement;
|
||||||
|
|
||||||
// Make sure it's not a disconnected DOM node
|
|
||||||
//if ( !jQuery.contains( docElement, element ) ) {
|
|
||||||
// return new $.Point();
|
|
||||||
//}
|
|
||||||
|
|
||||||
if ( typeof element.getBoundingClientRect !== typeof undefined ) {
|
if ( typeof element.getBoundingClientRect !== typeof undefined ) {
|
||||||
boundingRect = element.getBoundingClientRect();
|
boundingRect = element.getBoundingClientRect();
|
||||||
}
|
}
|
||||||
|
@ -34,10 +34,10 @@
|
|||||||
|
|
||||||
(function ( $ ) {
|
(function ( $ ) {
|
||||||
|
|
||||||
// dictionary from id to private properties
|
// dictionary from id to private properties
|
||||||
var THIS = {};
|
var THIS = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The CollectionDrawer is a reimplementation if the Drawer API that
|
* The CollectionDrawer is a reimplementation if the Drawer API that
|
||||||
* focuses on allowing a viewport to be redefined as a collection
|
* focuses on allowing a viewport to be redefined as a collection
|
||||||
* of smaller viewports, defined by a clear number of rows and / or
|
* of smaller viewports, defined by a clear number of rows and / or
|
||||||
@ -56,7 +56,7 @@
|
|||||||
* require better abstraction at those points in order to effeciently
|
* require better abstraction at those points in order to effeciently
|
||||||
* reuse those paradigms.
|
* reuse those paradigms.
|
||||||
*/
|
*/
|
||||||
$.ReferenceStrip = function ( options ) {
|
$.ReferenceStrip = function ( options ) {
|
||||||
|
|
||||||
var _this = this,
|
var _this = this,
|
||||||
viewer = options.viewer,
|
viewer = options.viewer,
|
||||||
@ -217,9 +217,9 @@
|
|||||||
loadPanels( this, this.scroll == 'vertical' ? viewerSize.y : viewerSize.y, 0 );
|
loadPanels( this, this.scroll == 'vertical' ? viewerSize.y : viewerSize.y, 0 );
|
||||||
this.setFocus( 0 );
|
this.setFocus( 0 );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$.extend( $.ReferenceStrip.prototype, $.EventHandler.prototype, $.Viewer.prototype, {
|
$.extend( $.ReferenceStrip.prototype, $.EventHandler.prototype, $.Viewer.prototype, {
|
||||||
|
|
||||||
setFocus: function ( page ) {
|
setFocus: function ( page ) {
|
||||||
var element = $.getElement( this.element.id + '-' + page ),
|
var element = $.getElement( this.element.id + '-' + page ),
|
||||||
@ -279,17 +279,17 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @inner
|
* @inner
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
function onStripDrag( tracker, eventData ) {
|
function onStripDrag( tracker, eventData ) {
|
||||||
|
|
||||||
var offsetLeft = Number( this.element.style.marginLeft.replace( 'px', '' ) ),
|
var offsetLeft = Number( this.element.style.marginLeft.replace( 'px', '' ) ),
|
||||||
offsetTop = Number( this.element.style.marginTop.replace( 'px', '' ) ),
|
offsetTop = Number( this.element.style.marginTop.replace( 'px', '' ) ),
|
||||||
@ -330,16 +330,16 @@
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @inner
|
* @inner
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
function onStripScroll( tracker, eventData ) {
|
function onStripScroll( tracker, eventData ) {
|
||||||
var offsetLeft = Number( this.element.style.marginLeft.replace( 'px', '' ) ),
|
var offsetLeft = Number( this.element.style.marginLeft.replace( 'px', '' ) ),
|
||||||
offsetTop = Number( this.element.style.marginTop.replace( 'px', '' ) ),
|
offsetTop = Number( this.element.style.marginTop.replace( 'px', '' ) ),
|
||||||
scrollWidth = Number( this.element.style.width.replace( 'px', '' ) ),
|
scrollWidth = Number( this.element.style.width.replace( 'px', '' ) ),
|
||||||
@ -378,10 +378,10 @@
|
|||||||
}
|
}
|
||||||
//cancels event
|
//cancels event
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function loadPanels( strip, viewerSize, scroll ) {
|
function loadPanels( strip, viewerSize, scroll ) {
|
||||||
var panelSize,
|
var panelSize,
|
||||||
activePanelsStart,
|
activePanelsStart,
|
||||||
activePanelsEnd,
|
activePanelsEnd,
|
||||||
@ -445,15 +445,15 @@
|
|||||||
element.activePanel = true;
|
element.activePanel = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @inner
|
* @inner
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
function onStripEnter( tracker, eventData ) {
|
function onStripEnter( tracker, eventData ) {
|
||||||
|
|
||||||
//$.setElementOpacity(tracker.element, 0.8);
|
//$.setElementOpacity(tracker.element, 0.8);
|
||||||
|
|
||||||
@ -472,15 +472,15 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @inner
|
* @inner
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
function onStripExit( tracker, eventData ) {
|
function onStripExit( tracker, eventData ) {
|
||||||
if ( 'horizontal' == this.scroll ) {
|
if ( 'horizontal' == this.scroll ) {
|
||||||
|
|
||||||
//tracker.element.style.paddingTop = "10px";
|
//tracker.element.style.paddingTop = "10px";
|
||||||
@ -493,16 +493,16 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
* @inner
|
* @inner
|
||||||
* @function
|
* @function
|
||||||
*/
|
*/
|
||||||
function onKeyPress( tracker, eventData ) {
|
function onKeyPress( tracker, eventData ) {
|
||||||
//console.log( eventData.keyCode );
|
//console.log( eventData.keyCode );
|
||||||
|
|
||||||
switch ( eventData.keyCode ) {
|
switch ( eventData.keyCode ) {
|
||||||
@ -535,7 +535,7 @@
|
|||||||
//console.log( 'navigator keycode %s', eventData.keyCode );
|
//console.log( 'navigator keycode %s', eventData.keyCode );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user