This repository was archived by the owner on Apr 8, 2020. It is now read-only.
File tree 4 files changed +3250
-3
lines changed 4 files changed +3250
-3
lines changed Original file line number Diff line number Diff line change 1
1
import * as ko from 'knockout' ;
2
+ import * as $ from 'jquery' ;
2
3
import crossroads = require( 'crossroads' ) ;
3
4
4
5
// This module configures crossroads.js, a routing library. If you prefer, you
@@ -28,7 +29,7 @@ export class Router {
28
29
// Make history.js watch for navigation and notify Crossroads
29
30
this . disposeHistory = history . listen ( location => crossroads . parse ( location . pathname ) ) ;
30
31
this . clickEventListener = evt => {
31
- let target : any = evt . target ;
32
+ let target : any = evt . currentTarget ;
32
33
if ( target && target . tagName === 'A' ) {
33
34
let href = target . getAttribute ( 'href' ) ;
34
35
if ( href && href . charAt ( 0 ) == '/' ) {
@@ -38,12 +39,12 @@ export class Router {
38
39
}
39
40
} ;
40
41
41
- document . addEventListener ( 'click' , this . clickEventListener ) ;
42
+ $ ( document ) . on ( 'click' , 'a ', this . clickEventListener ) ;
42
43
}
43
44
44
45
public dispose ( ) {
45
46
this . disposeHistory ( ) ;
46
- document . removeEventListener ( 'click' , this . clickEventListener ) ;
47
+ $ ( document ) . off ( 'click' , 'a ', this . clickEventListener ) ;
47
48
}
48
49
}
49
50
Original file line number Diff line number Diff line change 28
28
},
29
29
"isomorphic-fetch/isomorphic-fetch.d.ts" : {
30
30
"commit" : " 57ec5fbb76060329c10959d449eb1d4e70b15a65"
31
+ },
32
+ "jquery/jquery.d.ts" : {
33
+ "commit" : " f470e7569e7046c62866f57bc4fea56ba79975d5"
31
34
}
32
35
}
33
36
}
You can’t perform that action at this time.
0 commit comments