File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 12
12
this . _$document = $ ( document )
13
13
this . _$window = $ ( window )
14
14
this . _$body = $ ( document . body )
15
+
16
+ this . _boundClick = $ . proxy ( this . _clickHandler , this )
15
17
}
16
18
17
19
ZoomService . prototype . listen = function ( ) {
37
39
// todo(fat): probably worth throttling this
38
40
this . _$window . on ( 'scroll.zoom' , $ . proxy ( this . _scrollHandler , this ) )
39
41
40
- this . _$document . on ( 'click.zoom' , $ . proxy ( this . _clickHandler , this ) )
41
42
this . _$document . on ( 'keyup.zoom' , $ . proxy ( this . _keyHandler , this ) )
42
43
this . _$document . on ( 'touchstart.zoom' , $ . proxy ( this . _touchStart , this ) )
43
44
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
+
44
49
e . stopPropagation ( )
45
50
}
46
51
56
61
this . _$window . off ( '.zoom' )
57
62
this . _$document . off ( '.zoom' )
58
63
64
+ document . removeEventListener ( 'click' , this . _boundClick , true )
65
+
59
66
this . _activeZoom = null
60
67
}
61
68
You can’t perform that action at this time.
0 commit comments