File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 11/public /build
22public /service-worker.js
33/node_modules
4- /public /sw-toolbox.js
4+ /public /sw-toolbox.js
5+ dist /
Original file line number Diff line number Diff line change @@ -116,6 +116,16 @@ var Comment = React.createClass({
116116 }
117117 } ,
118118
119+ onCommentClick ( e ) {
120+ if ( e . target . tagName !== 'A' ) {
121+ this . toggleCollapse ( e )
122+ }
123+ else {
124+ e . preventDefault ( )
125+ window . open ( e . target . href , '_blank' )
126+ }
127+ } ,
128+
119129 toggleCollapse ( e ) {
120130 e . preventDefault ( )
121131 this . props . threadStore . toggleCollapse ( this . state . comment . id )
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ var CommentMixin = {
112112 } ,
113113
114114 renderCommentText ( comment , options ) {
115- return < div className = "Comment__text" onClick = { this . toggleCollapse } >
115+ return < div className = "Comment__text" onClick = { this . onCommentClick } >
116116 { ( ! comment . dead || SettingsStore . showDead ) ? < div dangerouslySetInnerHTML = { { __html : comment . text } } /> : '[dead]' }
117117 { SettingsStore . replyLinks && options . replyLink && ! comment . dead && < p >
118118 < a href = { `https://news.ycombinator.com/reply?id=${ comment . id } ` } > reply</ a >
You can’t perform that action at this time.
0 commit comments