Skip to content

Commit

Permalink
Merge pull request #58 from discoverygarden/DGIR-116
Browse files Browse the repository at this point in the history
DGIR-116: Copy citation button
  • Loading branch information
willtp87 authored Dec 5, 2023
2 parents d470199 + 61be835 commit 67034cc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Form/SelectCslForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,21 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#theme_wrappers' => [],
];

$form['actions']['submit'] = [
'#type' => 'button',
'#value' => $this->t('Copy to Clipboard'),
'#attributes' => [
'onclick' => 'return false;',
'class' => ['clipboard-button'],
'data-clipboard-target' => '#formatted-citation',
],
'#attached' => [
'library' => [
'islandora_citations/drupal',
],
],
];

$form['#cache']['contexts'][] = 'url';
$form['#theme'] = 'display_citations';
return $form;
Expand Down

0 comments on commit 67034cc

Please sign in to comment.