Skip to content

Commit

Permalink
responsive popover direction
Browse files Browse the repository at this point in the history
  • Loading branch information
sneakers-the-rat committed Nov 2, 2024
1 parent d43626d commit b12141e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/javascript/custom/papers.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ const copyText = (text) => {
}
window.copyText = copyText;

$('[data-toggle="popover"]').popover()
$('#badge-copy-button').popover({
placement: window.screen.width > 500 ? 'left' : 'bottom'
})
2 changes: 1 addition & 1 deletion app/views/papers/_badge.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<div class="badge-container" id="markdown-badge">
<img id="reviewer-badge" src="<%= badge_url %>">
<button
id="badge-copy-button"
class="btn btn-outline-secondary btn-sm"
data-toggle="popover"
data-placement="left"
title="Copied!"
data-content="<pre><%= badge_markdown %></pre>"
data-sanitize="false"
Expand Down

0 comments on commit b12141e

Please sign in to comment.