Skip to content

Commit

Permalink
hide the wpcom plugin banner when searching and have results
Browse files Browse the repository at this point in the history
  • Loading branch information
dsas committed Apr 30, 2024
1 parent 3abdbc8 commit 98577cc
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,15 @@ document.addEventListener( 'DOMContentLoaded', () => {
`
);
} );

const wpcomPluginObserver = new MutationObserver( () => {
if (
! document.querySelector( '.plugin-install-search .current' ) ||
document.querySelector( '.no-plugin-results' )
) {
document.querySelector( '.wpcom-plugins-banner' ).classList.remove( 'hidden' );
} else {
document.querySelector( '.wpcom-plugins-banner' ).classList.add( 'hidden' );
}
} );
wpcomPluginObserver.observe( document.getElementById( 'plugin-filter' ), { childList: true } );

0 comments on commit 98577cc

Please sign in to comment.