Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widget options in popup #2758

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
basic toggling visibility of widgets section in popup
ablanathtanalba committed Jul 28, 2021
commit 2e459a3982fa268813e8104c7e0b4d896243474e
18 changes: 18 additions & 0 deletions src/js/popup.js
Original file line number Diff line number Diff line change
@@ -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();
@@ -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
*/