Skip to content

Commit

Permalink
Add comments explaining function of event listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaifroid committed Jan 13, 2019
1 parent d6d39da commit e179c98
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions www/js/lib/uiUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,16 @@ define([], function() {
'</div>';
document.getElementById('alertBoxHeader').innerHTML = alertHTML;
['swModeLink', 'stop'].forEach(function(id) {
// Define event listeners for both hyperlinks in alert box: these take the user to the Config tab and highlight
// the options that the user needs to select
document.getElementById(id).addEventListener('click', function () {
var elementID = id === 'stop' ? 'hideActiveContentWarningCheck' : 'serviceworkerModeRadio';
var thisLabel = document.getElementById(elementID).parentNode;
thisLabel.style.borderColor = 'red';
thisLabel.style.borderStyle = 'solid';
var btnHome = document.getElementById('btnHome');
[thisLabel, btnHome].forEach(function (ele) {
// Define event listeners to cancel the highlighting both on the highlighted element and on the Home tab
ele.addEventListener('mousedown', function () {
thisLabel.style.borderColor = '';
thisLabel.style.borderStyle = '';
Expand Down

0 comments on commit e179c98

Please sign in to comment.