Skip to content

Commit

Permalink
addressed feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
advay26 committed Apr 16, 2024
1 parent a294be8 commit f1d232b
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/NuGetGallery/Scripts/gallery/page-list-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,35 +56,35 @@ $(function() {

if (advancedSearchToggleButton) {
advancedSearchToggleButton.addEventListener('click', toggleAdvancedSearchPanel);

window.addEventListener('resize', () => {
resized = true;
toggleAdvancedSearchPanel();
});
}

window.addEventListener('resize', () => {
resized = true;
toggleAdvancedSearchPanel();
});

/* For narrow screens only */
function toggleAdvancedSearchPanel() {

const filtersContent = document.getElementById('advancedSearchPanel');

if (filtersContent) {
var computedStyle = window.getComputedStyle(filtersContent);
}

if (window.innerWidth <= 992 && !resized) {
filtersContent.style.display = (computedStyle.display === 'none') ? 'block' : 'none';
chevronIcon.classList.toggle('ms-Icon--ChevronDown');
chevronIcon.classList.toggle('ms-Icon--ChevronUp');
}
else if (window.innerWidth <= 992 && initialScreenSize > 992 && resized) {
filtersContent.style.display = 'none';
chevronIcon.classList.add('ms-Icon--ChevronDown');
chevronIcon.classList.remove('ms-Icon--ChevronUp');
if (window.innerWidth <= 992 && !resized) {
filtersContent.style.display = (computedStyle.display === 'none') ? 'block' : 'none';
chevronIcon.classList.toggle('ms-Icon--ChevronDown');
chevronIcon.classList.toggle('ms-Icon--ChevronUp');
}
else if (window.innerWidth <= 992 && initialScreenSize > 992 && resized) {
filtersContent.style.display = 'none';
chevronIcon.classList.add('ms-Icon--ChevronDown');
chevronIcon.classList.remove('ms-Icon--ChevronUp');

}
else if (window.innerWidth > 992) {
filtersContent.style.display = 'block';
}
else if (window.innerWidth > 992) {
filtersContent.style.display = 'block';
}
}

initialScreenSize = window.innerWidth;
Expand Down

0 comments on commit f1d232b

Please sign in to comment.