Commit c05275a2 authored by Robert Speicher's avatar Robert Speicher

Add copy_to_clipboard JS

parent 20164159
#= require clipboard
$ ->
clipboard = new Clipboard '.js-clipboard-trigger',
text: (trigger) ->
$target = $(trigger.nextElementSibling || trigger.previousElementSibling)
$'clipboard-text') || $target.text().trim()
clipboard.on 'success', (e) ->
tooltip(trigger: 'manual', placement: 'auto bottom', title: 'Copied!').
# Clear the selection and blur the trigger so it loses its border
# Manually hide the tooltip after 1 second
, 1000)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment