fix comment preview and scroll to the just created comment after posting it

This commit is contained in:
Mario
2025-07-27 09:52:48 +00:00
parent e5c54fadea
commit b5a798f068
2 changed files with 7 additions and 1 deletions

View File

@@ -70,7 +70,7 @@ require_once('include/security.php');
define('PLATFORM_NAME', 'hubzilla');
define('STD_VERSION', '10.5.1');
define('STD_VERSION', '10.5.2');
define('ZOT_REVISION', '6.0');
define('DB_UPDATE_VERSION', 1263);

View File

@@ -1790,6 +1790,7 @@ function doreply(parent, ident, owner, hint) {
modal_content.innerHTML = '';
modal_content.append(form);
modal_content.append(preview);
// Set the value of the input named 'parent'
const parentInput = form.querySelector('input[name=parent]');
@@ -1830,6 +1831,7 @@ function doreply(parent, ident, owner, hint) {
modal_container.addEventListener('hide.bs.modal', event => {
// move form back to where it was
form_container.append(form);
form_container.append(preview);
});
// Set the textarea value
@@ -2071,6 +2073,10 @@ function post_comment(id) {
$("#comment-edit-text-" + id).val('').blur().attr('placeholder', aStr.comment);
$('#wall-item-sub-thread-wrapper-' + data.thr_parent_id).append(data.html);
const comment = document.getElementById('wall-item-content-wrapper-' + data.id);
comment.classList.add('item-highlight-fade');
comment.scrollIntoView();
updateRelativeTime('.autotime');
$('body').css('cursor', 'unset');
collapseHeight();