Skip to content

Commit

Permalink
Add copy-to-clipboard on issue page (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
jajodiaraghav authored and Sean Auriti committed Jul 8, 2017
1 parent 6bf83b3 commit b70a147
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
7 changes: 7 additions & 0 deletions website/static/js/clipboard.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions website/static/js/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ window.twttr = (function(d, s, id) {
fjs.parentNode.insertBefore(js, fjs);

}(document, 'script', 'facebook-jssdk'));

$(function() {
new Clipboard('.btn');
$('.copy-btn').on('click', function(){
$.notify('Copied!', "success");
});
});
8 changes: 6 additions & 2 deletions website/templates/issue.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@
}
{% endblock %}
{% block content %}
<div id="fb-root"></div>
<script type="text/javascript" src="{% static "js/issue.js" %}"></script>
<div id="fb-root"></div>
<script type="text/javascript" src="{% static "js/clipboard.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/lightbox.min.js" %}"></script>
<script type="text/javascript" src="{% static "js/issue.js" %}"></script>
<div class="row">
<div class="col-lg-12">
<h3 class="page-header">
{{object.description}}
<button class="btn copy-btn" data-clipboard-text="{{object.description}}">
<i class="glyphicon glyphicon-copy"></i>
</button>
<span class="pull-right">
<i class="fa fa-eye"></i> {{object.views}}
</span>
Expand Down

0 comments on commit b70a147

Please sign in to comment.