Merge pull request 'fix: make avatars not draggable and selectable' (#11) from Cyber/LinkUp-P2P-Chat:main into main
Reviewed-on: #11 Good Job!
This commit is contained in:
commit
9d759e5af3
5
app.js
5
app.js
@ -631,6 +631,7 @@ function addFileMessage(from, fileName, fileUrl, fileType, avatar, topic) {
|
|||||||
const $img = document.createElement('img');
|
const $img = document.createElement('img');
|
||||||
$img.src = updatePortInUrl(avatar) || 'https://via.placeholder.com/40';
|
$img.src = updatePortInUrl(avatar) || 'https://via.placeholder.com/40';
|
||||||
$img.classList.add('avatar');
|
$img.classList.add('avatar');
|
||||||
|
$img.draggable = false;
|
||||||
$div.appendChild($img);
|
$div.appendChild($img);
|
||||||
|
|
||||||
const $content = document.createElement('div');
|
const $content = document.createElement('div');
|
||||||
@ -695,6 +696,7 @@ function onMessageAdded(from, message, avatar, topic, timestamp) {
|
|||||||
const $img = document.createElement('img');
|
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.src = updatePortInUrl(avatar) || 'https://via.placeholder.com/40'; // Default to a placeholder image if avatar URL is not provided
|
||||||
$img.classList.add('avatar');
|
$img.classList.add('avatar');
|
||||||
|
$img.draggable = false;
|
||||||
$div.appendChild($img);
|
$div.appendChild($img);
|
||||||
|
|
||||||
const $content = document.createElement('div');
|
const $content = document.createElement('div');
|
||||||
@ -777,6 +779,7 @@ function addAudioMessage(from, audioUrl, avatar, topic) {
|
|||||||
const $img = document.createElement('img');
|
const $img = document.createElement('img');
|
||||||
$img.src = updatePortInUrl(avatar) || 'https://via.placeholder.com/40';
|
$img.src = updatePortInUrl(avatar) || 'https://via.placeholder.com/40';
|
||||||
$img.classList.add('avatar');
|
$img.classList.add('avatar');
|
||||||
|
$img.draggable = false;
|
||||||
$div.appendChild($img);
|
$div.appendChild($img);
|
||||||
|
|
||||||
const $content = document.createElement('div');
|
const $content = document.createElement('div');
|
||||||
@ -939,4 +942,4 @@ async function connectToAllRooms() {
|
|||||||
// Call this function when loading the rooms initially
|
// Call this function when loading the rooms initially
|
||||||
renderRoomList();
|
renderRoomList();
|
||||||
|
|
||||||
initialize();
|
initialize();
|
||||||
|
Loading…
Reference in New Issue
Block a user