Skip to content

Commit

Permalink
Open detail pane DOI link in browser (fixes #79)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rik Smith-Unna committed Jun 28, 2017
1 parent 1f5977e commit 6483dc5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/client/views/detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const C = require('../lib/constants')

const isString = require('lodash/isString')
const intersection = require('lodash/intersection')
const open = require('opn')

const height = 200
const padding = 5
Expand Down Expand Up @@ -166,6 +167,13 @@ function renderTitle (title) {

function singlepaper (paper, style, state, emit) {
if (!paper) return null

const doibtn = html`<a href="#">${paper.id}</a>`
doibtn.onclick = e => {
e.preventDefault()
open(`http://doi.org/${paper.id}`)
}

return html`
<div class="${style.wrapper}">
Expand All @@ -186,7 +194,7 @@ function singlepaper (paper, style, state, emit) {
${renderAbstract(paper.abstract)}
</div>
<div class="${style.doi} ${style.row} ${style.datum}">
<span>DOI: <a href="http://doi.org/${paper.id}">${paper.id}</a></span>
<span>DOI: ${doibtn}</span>
</div>
</div>
<div class="${style.column}">
Expand Down

0 comments on commit 6483dc5

Please sign in to comment.