Fix image click handler and emoji popup
This commit is contained in:
parent
21797788a2
commit
ebf5b3f47e
|
@ -9,7 +9,13 @@ body {
|
||||||
/* No dragging images - it plays wrongly with the drag/drop image sharing feature
|
/* No dragging images - it plays wrongly with the drag/drop image sharing feature
|
||||||
and users can accidentally share in chat by dragging an on-page image */
|
and users can accidentally share in chat by dragging an on-page image */
|
||||||
img {
|
img {
|
||||||
pointer-events: none;
|
/* https://stackoverflow.com/questions/12906789/preventing-an-image-from-being-draggable-or-selectable-without-using-js */
|
||||||
|
user-drag: none;
|
||||||
|
user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-webkit-user-drag: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.float-right {
|
.float-right {
|
||||||
|
|
|
@ -2800,6 +2800,13 @@ export default {
|
||||||
let $body = document.querySelector("body");
|
let $body = document.querySelector("body");
|
||||||
|
|
||||||
// Set up drag/drop file upload events.
|
// Set up drag/drop file upload events.
|
||||||
|
$body.addEventListener("dragstart", (e) => {
|
||||||
|
// Nothing ON the page should begin being draggable. Prevents on-page images from
|
||||||
|
// being dragged and then dropped (and sent as files on chat), but still allows
|
||||||
|
// their click handler to view in the lightbox modal.
|
||||||
|
e.preventDefault();
|
||||||
|
return false;
|
||||||
|
})
|
||||||
$body.addEventListener("dragenter", (e) => {
|
$body.addEventListener("dragenter", (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
|
@ -311,7 +311,7 @@ export default {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column dropdown is-right"
|
<div class="column dropdown is-right"
|
||||||
:class="{ 'is-up': position >= 2 || reportEnabled, 'is-active': showEmojiPicker }"
|
:class="{ 'is-up': position >= 2, 'is-active': showEmojiPicker }"
|
||||||
@click="showEmojiPicker = true">
|
@click="showEmojiPicker = true">
|
||||||
<div class="dropdown-trigger">
|
<div class="dropdown-trigger">
|
||||||
<button type="button" class="button is-small px-2" aria-haspopup="true"
|
<button type="button" class="button is-small px-2" aria-haspopup="true"
|
||||||
|
@ -411,7 +411,7 @@ export default {
|
||||||
<div class="columns is-mobile is-gapless mb-0">
|
<div class="columns is-mobile is-gapless mb-0">
|
||||||
<!-- More buttons menu (DM, mute, report, etc.) -->
|
<!-- More buttons menu (DM, mute, report, etc.) -->
|
||||||
<div class="column dropdown is-right"
|
<div class="column dropdown is-right"
|
||||||
:class="{ 'is-up': position >= 2 || reportEnabled, 'is-active': menuVisible }"
|
:class="{ 'is-up': position >= 2, 'is-active': menuVisible }"
|
||||||
@click="menuVisible = !menuVisible">
|
@click="menuVisible = !menuVisible">
|
||||||
<div class="dropdown-trigger">
|
<div class="dropdown-trigger">
|
||||||
<button type="button" class="button is-small px-2 mr-1" aria-haspopup="true"
|
<button type="button" class="button is-small px-2 mr-1" aria-haspopup="true"
|
||||||
|
@ -463,7 +463,7 @@ export default {
|
||||||
|
|
||||||
<!-- Emoji reactions -->
|
<!-- Emoji reactions -->
|
||||||
<div class="column dropdown is-right"
|
<div class="column dropdown is-right"
|
||||||
:class="{ 'is-up': position >= 2 || reportEnabled, 'is-active': showEmojiPicker }"
|
:class="{ 'is-up': position >= 2, 'is-active': showEmojiPicker }"
|
||||||
@click="showEmojiPicker = true">
|
@click="showEmojiPicker = true">
|
||||||
<div class="dropdown-trigger">
|
<div class="dropdown-trigger">
|
||||||
<button type="button" class="button is-small px-2" aria-haspopup="true"
|
<button type="button" class="button is-small px-2" aria-haspopup="true"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user