Skip to content

Commit

Permalink
Small changes to code style
Browse files Browse the repository at this point in the history
  • Loading branch information
cydrobolt committed Mar 29, 2018
1 parent 298c22a commit e5dbcda
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions public/js/shorten_result.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ $('#generate-qr-code').click(function () {
});


var clipboard = new Clipboard('[data-clipboard]');
var clipboard = new Clipboard('#clipboard-copy');
clipboard.on('success', function(e) {
e.clearSelection();
$('[data-clipboard]').tooltip('show');
$('#clipboard-copy').tooltip('show');
});
$('[data-clipboard]').on('blur',function () {
$(this).tooltip('destroy')

$('#clipboard-copy').on('blur',function () {
$(this).tooltip('destroy');
}).on('mouseleave',function () {
$(this).tooltip('destroy')
$(this).tooltip('destroy');
});

$(function () {
Expand Down
2 changes: 1 addition & 1 deletion resources/views/shorten_result.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<h3>Shortened URL</h3>
<div class="input-group">
<input type='text' class='result-box form-control' value='{{$short_url}}' id='short_url' />
<div class='input-group-addon' data-clipboard='' data-clipboard-target='#short_url' data-toggle='tooltip' data-placement='bottom' data-title='Copied!'>
<div class='input-group-addon' id='clipboard-copy' data-clipboard-target='#short_url' data-toggle='tooltip' data-placement='bottom' data-title='Copied!'>
<i class='fa fa-clipboard' aria-hidden='true' title='Copy to clipboard'></i>
</div>
</div>
Expand Down

0 comments on commit e5dbcda

Please sign in to comment.