From 882e35f14de4c2961de4df180588e2ce199103fd Mon Sep 17 00:00:00 2001 From: Cyber Date: Sat, 15 Jun 2024 15:42:35 +0200 Subject: [PATCH] fix: make avatars not draggable and selectable --- app.js | 5 ++++- style.css | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index deb8e8e..b1df6c3 100644 --- a/app.js +++ b/app.js @@ -631,6 +631,7 @@ function addFileMessage(from, fileName, fileUrl, fileType, avatar, topic) { const $img = document.createElement('img'); $img.src = updatePortInUrl(avatar) || 'https://via.placeholder.com/40'; $img.classList.add('avatar'); + $img.draggable = false; $div.appendChild($img); const $content = document.createElement('div'); @@ -695,6 +696,7 @@ function onMessageAdded(from, message, avatar, topic, timestamp) { const $img = document.createElement('img'); $img.src = updatePortInUrl(avatar) || 'https://via.placeholder.com/40'; // Default to a placeholder image if avatar URL is not provided $img.classList.add('avatar'); + $img.draggable = false; $div.appendChild($img); const $content = document.createElement('div'); @@ -777,6 +779,7 @@ function addAudioMessage(from, audioUrl, avatar, topic) { const $img = document.createElement('img'); $img.src = updatePortInUrl(avatar) || 'https://via.placeholder.com/40'; $img.classList.add('avatar'); + $img.draggable = false; $div.appendChild($img); const $content = document.createElement('div'); @@ -939,4 +942,4 @@ async function connectToAllRooms() { // Call this function when loading the rooms initially renderRoomList(); -initialize(); \ No newline at end of file +initialize(); diff --git a/style.css b/style.css index 6d0f986..a48d1e1 100644 --- a/style.css +++ b/style.css @@ -444,6 +444,7 @@ main { border-radius: 50%; margin-right: 0.5rem; border: 2px solid #464343; + user-select: none; } .message-content {