aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--view/css/conversation.css2
-rw-r--r--view/js/main.js16
2 files changed, 8 insertions, 10 deletions
diff --git a/view/css/conversation.css b/view/css/conversation.css
index 059b545c4..afae221db 100644
--- a/view/css/conversation.css
+++ b/view/css/conversation.css
@@ -218,7 +218,7 @@ a.wall-item-name-link {
width: 100%;
top: 0;
bottom: 0;
- margin: var(--bs-border-radius) 0 var(--bs-border-radius) 0;
+/* margin: var(--bs-border-radius) 0 var(--bs-border-radius) 0; */
}
.item-highlight-fade {
diff --git a/view/js/main.js b/view/js/main.js
index 609762da7..a05d95d3f 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -921,6 +921,9 @@ function updateConvItems(mode, data) {
if (!elem.parentNode.parentNode.classList.contains('toplevel_item')) {
elem.parentNode.parentNode.classList.add('item-highlight');
document.documentElement.style.setProperty('--hz-item-highlight', stringToHslColor(JSON.parse(elem.parentNode.parentNode.dataset.b64mids)[0]));
+ // Mark the comment button at the parent expanded
+ // TODO: should do that for all comments that have replies expanded
+ elem.parentNode.parentNode.querySelector('.wall-item-comment').classList.add('expanded');
}
}
@@ -1644,12 +1647,11 @@ const autoExpand = (function () {
async function autoExpand(id) {
const loading = document.getElementById('like-rotator-' + id);
+ let iteration = 0;
+ const maxIterations = 3;
clickedElements.clear();
- maxIterations = 3;
try {
- let iteration = 0;
-
// Step 1: Ensure initial button is clicked
const initBtnSelector = '#wall-item-comment-' + id;
const initBtn = await waitForElement(initBtnSelector);
@@ -1667,10 +1669,6 @@ const autoExpand = (function () {
const commentBtnSelector = `#wall-item-sub-thread-wrapper-${id} .wall-item-comment`;
do {
- if (iteration >= maxIterations) {
- return;
- }
-
newButtonsFound = false;
// Wait for any comment to appear
@@ -1693,9 +1691,9 @@ const autoExpand = (function () {
await new Promise(res => setTimeout(res, 700));
}
- } while (newButtonsFound);
+ } while (newButtonsFound && iteration <= maxIterations);
- console.log('All replies loaded!');
+ console.log('Replies loaded!');
loading.style.display = 'none';