Skip to content

Commit

Permalink
Handle jQuery corner case
Browse files Browse the repository at this point in the history
  • Loading branch information
olamothe committed Mar 1, 2017
1 parent bb1a45c commit 901efc4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gulpTasks/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ gulp.task('dev', ['setup', 'prepareSass'], (done)=> {
publicPath: '/js/',
compress: true,
headers: {
'Content-Security-Policy': "script-src 'self' 'unsafe-inline'"
'Content-Security-Policy': "script-src 'self' code.jquery.com 'unsafe-inline'"
}
});
server.listen(8080, 'localhost', ()=> {
Expand Down
5 changes: 5 additions & 0 deletions src/ui/PrintableUri/PrintableUri.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ export class PrintableUri extends Component {

private bindLogOpenDocument(link: HTMLElement) {
$$(link).on(['mousedown', 'touchend'], (e: Event) => {
// jQuery event != standard dom event for mouse events
// if we have access to the original event, use that.
if ((<any>e).originalEvent) {
e = (<any>e).originalEvent;
}
let url = $$(<HTMLElement>e.srcElement).getAttribute('href');
let title = $$(<HTMLElement>e.srcElement).text();
this.usageAnalytics.logClickEvent(analyticsActionCauseList.documentOpen, {
Expand Down

0 comments on commit 901efc4

Please sign in to comment.