File tree Expand file tree Collapse file tree 4 files changed +3250
-3
lines changed
Expand file tree Collapse file tree 4 files changed +3250
-3
lines changed Original file line number Diff line number Diff line change 11import * as ko from 'knockout' ;
2+ import * as $ from 'jquery' ;
23import crossroads = require( 'crossroads' ) ;
34
45// This module configures crossroads.js, a routing library. If you prefer, you
@@ -28,7 +29,7 @@ export class Router {
2829 // Make history.js watch for navigation and notify Crossroads
2930 this . disposeHistory = history . listen ( location => crossroads . parse ( location . pathname ) ) ;
3031 this . clickEventListener = evt => {
31- let target : any = evt . target ;
32+ let target : any = evt . currentTarget ;
3233 if ( target && target . tagName === 'A' ) {
3334 let href = target . getAttribute ( 'href' ) ;
3435 if ( href && href . charAt ( 0 ) == '/' ) {
@@ -38,12 +39,12 @@ export class Router {
3839 }
3940 } ;
4041
41- document . addEventListener ( 'click' , this . clickEventListener ) ;
42+ $ ( document ) . on ( 'click' , 'a ', this . clickEventListener ) ;
4243 }
4344
4445 public dispose ( ) {
4546 this . disposeHistory ( ) ;
46- document . removeEventListener ( 'click' , this . clickEventListener ) ;
47+ $ ( document ) . off ( 'click' , 'a ', this . clickEventListener ) ;
4748 }
4849}
4950
Original file line number Diff line number Diff line change 2828 },
2929 "isomorphic-fetch/isomorphic-fetch.d.ts" : {
3030 "commit" : " 57ec5fbb76060329c10959d449eb1d4e70b15a65"
31+ },
32+ "jquery/jquery.d.ts" : {
33+ "commit" : " f470e7569e7046c62866f57bc4fea56ba79975d5"
3134 }
3235 }
3336}
You can’t perform that action at this time.
0 commit comments