Skip to content

Commit 40fb499

Browse files
committed
Pill menu buttons are only shown if there is more than one summary, to avoid confusion
1 parent 3f68cc4 commit 40fb499

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

popup.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,15 @@ function initPopup() {
11721172
createdPills[pillId] = true;
11731173
});
11741174
}
1175+
// count the number of immediate div elements inside the #summaries-container, excluding any divs with class .aiQuestionFormContainer
1176+
var summariesContainer = document.querySelector('#summaries-container');
1177+
var divCount = Array.from(summariesContainer.children).filter(child => child.tagName === 'DIV' && !child.classList.contains('aiQuestionFormContainer')).length;
1178+
1179+
console.log("divCount: " + divCount);
1180+
// if there is less than 2 div elements inside the #summaries-container, hide the summary menu
1181+
if (divCount < 2) {
1182+
document.querySelector('#summary-menu').style.display = 'none';
1183+
}
11751184
}
11761185
});
11771186
updatePremiumFeaturesVisibility();

0 commit comments

Comments
 (0)