File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 this . _$document = $ ( document )
1313 this . _$window = $ ( window )
1414 this . _$body = $ ( document . body )
15+
16+ this . _boundClick = $ . proxy ( this . _clickHandler , this )
1517 }
1618
1719 ZoomService . prototype . listen = function ( ) {
3739 // todo(fat): probably worth throttling this
3840 this . _$window . on ( 'scroll.zoom' , $ . proxy ( this . _scrollHandler , this ) )
3941
40- this . _$document . on ( 'click.zoom' , $ . proxy ( this . _clickHandler , this ) )
4142 this . _$document . on ( 'keyup.zoom' , $ . proxy ( this . _keyHandler , this ) )
4243 this . _$document . on ( 'touchstart.zoom' , $ . proxy ( this . _touchStart , this ) )
4344
45+ // we use a capturing phase here to prevent unintended js events
46+ // sadly no useCapture in jquery api (http://bugs.jquery.com/ticket/14953)
47+ document . addEventListener ( 'click' , this . _boundClick , true )
48+
4449 e . stopPropagation ( )
4550 }
4651
5661 this . _$window . off ( '.zoom' )
5762 this . _$document . off ( '.zoom' )
5863
64+ document . removeEventListener ( 'click' , this . _boundClick , true )
65+
5966 this . _activeZoom = null
6067 }
6168
You can’t perform that action at this time.
0 commit comments