File tree 1 file changed +13
-5
lines changed
tests/dummy/app/components/vertical-pan-detector-pane
1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -13,24 +13,32 @@ export default class VerticalPanDetectorPane extends Component {
13
13
@action
14
14
setupHammer ( el ) {
15
15
this . element = el ;
16
- let mc = this . mc = new Hammer . Manager ( this . element , {
16
+ let hammer = this . hammer = new Hammer . Manager ( this . element , {
17
17
inputClass : Hammer . TouchMouseInput ,
18
18
recognizers : [
19
19
[ Hammer . Pan ]
20
20
]
21
21
} ) ;
22
- mc . get ( 'pan' ) . set ( { direction : Hammer . DIRECTION_VERTICAL } ) ;
23
- mc . on ( "panup pandown" , ( ev ) => {
22
+ hammer . get ( 'pan' ) . set ( { direction : Hammer . DIRECTION_VERTICAL } ) ;
23
+ hammer . on ( "panup pandown" , ( ev ) => {
24
24
this . statusText = ev . type + " gesture detected" ;
25
25
} ) ;
26
26
27
27
schedule ( 'afterRender' , this , ( ) => {
28
- this . gesture . register ( this , mc . get ( 'pan' ) ) ;
28
+ this . gesture . register ( this , hammer . get ( 'pan' ) ) ;
29
29
} ) ;
30
30
}
31
31
32
32
@action
33
33
teardownHammer ( ) {
34
- this . gesture . unregister ( this , this . mc . get ( 'pan' ) ) ;
34
+ this . gesture . unregister ( this , this . hammer . get ( 'pan' ) ) ;
35
+ }
36
+
37
+ preferRecognizer ( recognizer ) {
38
+ this . hammer . get ( 'pan' ) . requireFailure ( recognizer ) ;
39
+ }
40
+
41
+ stopPreferringRecognizer ( recognizer ) {
42
+ this . hammer . get ( 'pan' ) . dropRequireFailure ( recognizer ) ;
35
43
}
36
44
}
You can’t perform that action at this time.
0 commit comments