@@ -1401,17 +1401,19 @@ VirtualSky.prototype.createSky = function(){
1401
1401
} . bind ( this )
1402
1402
} ;
1403
1403
1404
-
1405
- function getXY ( sky , o , el , e ) {
1406
- e . x = o . pageX - el . offset ( ) . left - window . scrollX ;
1407
- e . y = o . pageY - el . offset ( ) . top - window . scrollY ;
1404
+ function getXYProperties ( e , sky ) {
1408
1405
e . matched = sky . whichPointer ( e . x , e . y ) ;
1409
1406
var skyPos = sky . xy2radec ( e . x , e . y ) ;
1410
1407
if ( skyPos ) {
1411
1408
e . ra = skyPos . ra / sky . d2r ;
1412
1409
e . dec = skyPos . dec / sky . d2r ;
1413
1410
}
1414
- return e ;
1411
+ return e ;
1412
+ }
1413
+ function getXY ( sky , o , el , e ) {
1414
+ e . x = o . pageX - el . offset ( ) . left - window . scrollX ;
1415
+ e . y = o . pageY - el . offset ( ) . top - window . scrollY ;
1416
+ return getXYProperties ( e , sky ) ;
1415
1417
}
1416
1418
1417
1419
S ( "#" + this . idinner ) . on ( 'click' , { sky :this } , function ( e ) {
@@ -1533,6 +1535,11 @@ VirtualSky.prototype.createSky = function(){
1533
1535
x = x - this . offset ( ) . left - window . scrollX ;
1534
1536
y = y - this . offset ( ) . top - window . scrollY ;
1535
1537
contextMenuHandler . longPressStart ( x , y ) ;
1538
+ if ( e . data . sky . callback . click ) {
1539
+ e . x = x ;
1540
+ e . y = y ;
1541
+ e . data . sky . callback . click . call ( e . data . sky , getXYProperties ( e , e . data . sky ) ) ;
1542
+ }
1536
1543
}
1537
1544
} ) . on ( 'touchend' , { sky :this } , function ( e ) {
1538
1545
e . data . sky . debug ( 'touchend' ) ;
0 commit comments