Commit 04daedf2 authored by Robert Hitt's avatar Robert Hitt
Browse files

Moved inline JS. Also added Tooltip for copy btn.

parent 5c990d2b
Pipeline #390 passed with stage
in 3 minutes and 34 seconds
......@@ -22,17 +22,10 @@
<div class="container">
<div class="col-md-8">
<h3>Go Address:</h3>
<a id="link" href="{{url.short}}">{{domain}}{{url.short}}</a>
<button type="button" class="button btn btn-default btn-xs fa" role="button"
id="btn" data-clipboard-target="#link">
<i class="fa fa-clipboard" aria-hidden="true"></i> Copy to clipboard</button>
<script src="../../static/js/clipboard.min.js"></script>
var btn = document.getElementById('btn');
var clipboard = new Clipboard(btn);
<a id="link" href="{{url.short}}">{{domain}}{{url.short}}</a>
<button id="btn" type="button" class="button btn btn-default btn-xs fa" role="button"
<i class="fa fa-clipboard" aria-hidden="true"></i></button>
<h3>Address Details:</h3>
......@@ -104,6 +97,8 @@
<script src="../../static/js/clipboard.min.js"></script>
<script src="../../static/js/copy.js"></script>
$(function () {
var option = {'trigger': 'hover'};
* Script for copying text and displaying a tooltip.
trigger: 'click',
placement: 'bottom'
function setTooltip(button, message) {
$(button).tooltip('hide').attr('data-original-title', message)
function hideTooltip(button) {
window.setTimeout(function() {
}, 700);
var clipboard = new Clipboard('#btn');
clipboard.on('success', function(e) {
setTooltip(e.trigger, 'Copied!');
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