Skip to content

Commit

Permalink
basic toggling visibility of widgets section in popup
Browse files Browse the repository at this point in the history
  • Loading branch information
ablanathtanalba committed Jul 28, 2021
1 parent 4ffad9d commit 2e459a3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ function init() {
// add event listeners for click-to-expand first party protections popup section
$('#firstparty-protections-header').on('click', toggleFirstPartyInfoHandler);

// add event listeners for click-to-expand widgets section
$('#replaced-widgets-header').on('click', toggleWidgetsSectionHandler);

// show firstparty protections message if current tab is in our content scripts
if (POPUP_DATA.enabled && POPUP_DATA.isOnFirstParty) {
$("#firstparty-protections-container").show();
Expand Down Expand Up @@ -508,6 +511,21 @@ function toggleFirstPartyInfoHandler() {
}
}

/**
* Click handler for showing/hiding the replaced widgets section
*/
function toggleWidgetsSectionHandler() {
if ($('#collapse-widgets-popup').is(":visible")) {
$("#collapse-widgets-popup").hide();
$("#expand-widgets-popup").show();
$("#instructions-widgets-description").slideUp();
} else {
$("#collapse-widgets-popup").show();
$("#expand-widgets-popup").hide();
$("#instructions-widgets-description").slideDown();
}
}

/**
* Handler to undo user selection for a tracker
*/
Expand Down

0 comments on commit 2e459a3

Please sign in to comment.