Skip to content

Commit

Permalink
show citekey pane info
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed May 13, 2024
1 parent 64a9bcb commit 9a50efa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions content/better-bibtex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -871,14 +871,17 @@ export class BetterBibTeX {
const citekey = item.getField('citationKey')
body.ownerDocument.getElementById('better-bibtex-citation-key').value = citekey || '\u274C'
setSectionSummary(citekey || '')
flash('item display', `item ${item?.id} displayed`)
},
onInit: ({ refresh }) => {
$refresh = refresh
$done = Events.on('items-changed', ({ items }) => {
flash('citekey refresh', `items ${items.map(item => item.id)} changed ${$displayed} displayed, so ${items.map(item => item.id).includes($displayed) ? 'do a' : 'no'} refresh`)
if ($refresh && items.map(item => item.id).includes($displayed)) $refresh()
})
},
onItemChange: ({ body, item }) => {
flash('item display', `item ${item?.id} displayed`)
$displayed = item.id
const citekey = item.getField('citationKey')
body.ownerDocument.getElementById('better-bibtex-citation-key').value = citekey || '\u274C'
Expand Down

0 comments on commit 9a50efa

Please sign in to comment.