Skip to content

Commit

Permalink
add basic click handlers for widget section
Browse files Browse the repository at this point in the history
  • Loading branch information
ablanathtanalba committed Apr 7, 2021
1 parent 39a2cd5 commit 460963a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ function init() {
$('#expand-firstparty-popup').on('click', showFirstPartyInfoHandler);
$('#collapse-firstparty-popup').on('click', hideFirstPartyInfoHandler);

$('#expand-widget-resources').on('click', showWidgetHandler);
$('#collapse-widget-resources').on('click', hideWidgetHandler);

if (POPUP_DATA.showExpandedTrackingSection) {
$('#expand-blocked-resources').hide();
$('#collapse-blocked-resources').show();
Expand All @@ -213,6 +216,9 @@ function init() {
$('#instructions-firstparty-description').hide();
$('#collapse-firstparty-popup').hide();

$('#widget-menu-section').hide();
$('#collapse-widget-resources').hide();

// check if any firstparty scripts are run on current tab & show message in popup
async function fetchFirstPartiesManifest() {
// fetch the manifest
Expand Down Expand Up @@ -511,6 +517,20 @@ function hideFirstPartyInfoHandler() {
$("#expand-firstparty-popup").show();
$("#instructions-firstparty-description").hide();
}
/**
* Click handlers for showing/hiding the widgets popup info text
*/
function showWidgetHandler() {
$("#collapse-widget-resources").show();
$("#expand-widget-resources").hide();
$("#widget-menu-section").show();
}

function hideWidgetHandler() {
$("#collapse-widget-resources").hide();
$("#expand-widget-resources").show();
$("#widget-menu-section").hide();
}

/**
* Handler to undo user selection for a tracker
Expand Down
1 change: 1 addition & 0 deletions src/skin/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ <h2 id="title-name"><span class="i18n_name"></span></h2>
<div id="widget-replacement-dropdown">
<span id="expand-widget-resources" class="ui-icon ui-icon-caret-d"></span>
<span id="collapse-widget-resources" class="ui-icon ui-icon-caret-u"></span>
<div id="widget-menu-section"></div>
</div>
</div>

Expand Down

0 comments on commit 460963a

Please sign in to comment.