comparison src/chat.js @ 109:b86bb25fb416 default tip

reply fix
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 14 Sep 2025 15:58:52 -0600
parents ed1418c95488
children
comparison
equal deleted inserted replaced
108:2c85ae7b8a35 109:b86bb25fb416
431 let postId = getPostId(el); 431 let postId = getPostId(el);
432 let div = document.querySelector('div[reply]'); 432 let div = document.querySelector('div[reply]');
433 div.removeAttribute('hidden'); 433 div.removeAttribute('hidden');
434 div.setAttribute('reply',postId); 434 div.setAttribute('reply',postId);
435 document.querySelector('div[reply] div[text]').innerHTML = document.querySelector(`div[post="${postId}"] div[text]`).innerHTML 435 document.querySelector('div[reply] div[text]').innerHTML = document.querySelector(`div[post="${postId}"] div[text]`).innerHTML
436 let a = document.querySelector('div[reply] a'); 436 let a = document.querySelector('div[reply] a[when]');
437 a.href = `#p${postId}`; 437 a.href = `#p${postId}`;
438 a.textContent = document.querySelector(`div[post="${postId}"] span[when]`).textContent; 438 a.textContent = document.querySelector(`div[post="${postId}"] span[when]`).textContent;
439 document.querySelector('div[input] textarea').focus(); 439 document.querySelector('div[input] textarea').focus();
440 document.querySelector('div[input]').scrollIntoView({block: 'end'}); 440 document.querySelector('div[input]').scrollIntoView({block: 'end'});
441 } 441 }