Skip to content

Commit

Permalink
Fixed moderation panel appearance on touch devices (#285)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
csharpfritz and github-actions[bot] authored Nov 7, 2023
1 parent 3b12623 commit 9197e98
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/TagzApp.Web/Pages/Moderation.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
</div>
<div class="row" style="padding: 2px 10px!important">

<div id="taggedContent" class="">
<div id="pauseUpdates">
<i id="pauseButton" class="bi bi-pause-circle-fill text-info"></i>
<i id="pauseButton-bg" class="bi bi-circle-fill"></i>
</div>

<div id="taggedContent" class="">

<div id="pauseUpdates">
<i id="pauseButton" class="bi bi-pause-circle-fill text-info"></i>
<i id="pauseButton-bg" class="bi bi-circle-fill"></i>
</div>

</div>

Expand Down
10 changes: 6 additions & 4 deletions src/TagzApp.Web/wwwroot/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,9 @@ a {

/** Pause button on waterfall */
#pauseUpdates {
position: fixed;
position: absolute;
left: 1em;
bottom: 1em;
top: calc(100dvh - 6em);
cursor: pointer;
z-index: 50;
opacity: 0.6;
Expand All @@ -593,14 +593,16 @@ a {
}

#pauseButton {
position: absolute;
left: 0;
font-size: 4rem;
z-index: 1;
}

#pauseButton-bg {
font-size: 4rem;
z-index: -1;
position: absolute;
left: 0;
font-size: 4rem;
z-index: -1;
color: #fff;
}
12 changes: 11 additions & 1 deletion src/TagzApp.Web/wwwroot/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@
}

if (onclick) {
newMessage.addEventListener('touchend', (ev) => {
window.setTimeout(() => onclick(ev), 100);
});
} else {
newMessage.addEventListener('click', function (ev) {
var el = ev.target.closest('article');
Expand Down Expand Up @@ -440,7 +443,14 @@

function showModerationPanel(ev) {
var hovered = ev.target.closest('article');
if (hovered.querySelector('#moderationAction')) return;

// Remove all moderationAction elements inside of articles
var panels = document.querySelectorAll('article #moderationAction');
panels.forEach(function (panel) {
panel.remove();
});

if (hovered == null || hovered.querySelector('#moderationAction')) return;

// pause updates
window.clearTimeout(pauseTimeout);
Expand Down

0 comments on commit 9197e98

Please sign in to comment.