Skip to content

Commit

Permalink
choose "selected" by default if multiple tabs are selected when popup…
Browse files Browse the repository at this point in the history
… is opened
  • Loading branch information
rohanb10 committed Jun 7, 2021
1 parent 0555a05 commit 9b6bd4a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 3 additions & 5 deletions scripts/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,12 @@ async function buildTargets() {
// hide groups if not chrome
if (getBrowser() !== 'chrome' || true) document.getElementById('group').style.display = 'none';

if (isActiveTabValid) {
if (isSelectionValid) {
document.getElementById('selection').classList.add('active');
} else if (isActiveTabValid) {
document.getElementById('tab').classList.add('active');
} else if (isWindowValid) {
document.getElementById('window').classList.add('active');
} else if (isSelectionValid) {
document.getElementById('selection').classList.add('active');
// } else if (isGroupValid) {
// document.getElementById('group').classList.add('active');
} else {
document.querySelectorAll('.choice, .custom-choice, h3').forEach(c => {c.classList.add('disabled');c.setAttribute('tabindex','-1')});
return document.getElementById('preview-text').innerText = `Can't snooze this tab`;
Expand Down
1 change: 1 addition & 0 deletions scripts/track.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9b6bd4a

Please sign in to comment.