Skip to content

Commit

Permalink
Fixed broken print links (publiclab#5254)
Browse files Browse the repository at this point in the history
Added event listener to the links and added some custom styling for the same
  • Loading branch information
PritiShaw authored and icarito committed Apr 9, 2019
1 parent b3c5585 commit fd759c1
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions app/views/like/_like.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,23 @@
<hr style='clear:both;' />
<div>
<p><a href='#' onClick='print_linkless()'><i class='fa fa-print'></i> Print without page links</a></p>
<p><a href='#' onClick='print_three_column();'><i class='fa fa-print'></i> Print in 3-column layout</a></p>
<p><a id='print-command-no-links'><i class='fa fa-print'></i> Print without page links</a></p>
<p><a id='print-command-3-col'><i class='fa fa-print'></i> Print in 3-column layout</a></p>
</div>
"><span class="caret"></span></li>
">
<span class="caret"></span></li>
</ul>

<style type="text/css">
/*Styling the links to remove underline on hover and setting pointer as cursor*/
#print-command-3-col , #print-command-no-links {
text-decoration : none;
cursor : pointer;
}
</style>

<script>

function print_three_column() {
Expand All @@ -89,6 +100,10 @@
$('body').css('column-count', 1)
.css('column-gap', 0);
}
// Event listner on CLICK on links
$(document).on("click", "#print-command-3-col",print_three_column);
$(document).on("click", "#print-command-no-links",print_linkless);

jQuery(document).ready(function() {

// 304 cached response yields no data to insert, which is not useful
Expand Down

0 comments on commit fd759c1

Please sign in to comment.