Skip to content

Commit

Permalink
Update popup icon on audible and form input status changes
Browse files Browse the repository at this point in the history
  • Loading branch information
deanoemcke committed Jul 19, 2017
1 parent 50b6e77 commit 6abe254
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -1068,11 +1068,18 @@ var tgs = (function () {
queueSessionTimer();
}

//reset tab timer if tab has just finished playing audio
if (changeInfo.hasOwnProperty('audible') && !changeInfo.audible) {
if (gsUtils.getOption(gsUtils.IGNORE_AUDIO)) {
//check for change in tabs audible status
if (changeInfo.hasOwnProperty('audible')) {

//reset tab timer if tab has just finished playing audio
if (!changeInfo.audible && gsUtils.getOption(gsUtils.IGNORE_AUDIO)) {
resetTabTimer(tab.id);
}
//if tab is currently visible then update popup icon
if (tabId === globalCurrentTabId) {
var status = processActiveTabStatus(tab, 'normal');
updateIcon(status);
}
}

//check for tab having an unsuspend request
Expand Down
1 change: 1 addition & 0 deletions src/js/contentscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@
|| event.target.tagName.toUpperCase() === 'TEXTAREA'
|| event.target.tagName.toUpperCase() === 'FORM') {
inputState = true;
reportState(false);
}
}
}
Expand Down

0 comments on commit 6abe254

Please sign in to comment.