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

fixes #2576 - simple LH should only be offered alongside chrome tests #2580

Merged
merged 1 commit into from
Dec 12, 2022
Merged
Changes from all commits
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
19 changes: 18 additions & 1 deletion www/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,23 @@
</div>
<div class="fieldrow">
<label for="lighthouse-simple"><input type="checkbox" name="lighthouse" id="lighthouse-simple" class="checkbox"> Run Lighthouse Audit <small>(Runs on Chrome, emulated Moto G4 device, over simulated 3G Fast connection)</small></label>
<script>
// show or hide simple lighthouse field depending on whether chrome test is running
let simplePresets = document.querySelector('.test_presets_easy');
let lhSimpleFields = document.querySelector('[for=lighthouse-simple]');
function enableDisableLHSimple(){
let checkedPreset = simplePresets.querySelector('input[type=radio]:checked');
if(checkedPreset.parentElement.querySelector('img[alt*="chrome"]')){
lhSimpleFields.style.display = "block";
checkedPreset.disabled = false;
} else {
lhSimpleFields.style.display = "none";
checkedPreset.disabled = true;
}
}
enableDisableLHSimple();
simplePresets.addEventListener("click", enableDisableLHSimple );
</script>
</div>
<?php if ($is_paid) : ?>
<div class="fieldrow">
Expand Down Expand Up @@ -1139,4 +1156,4 @@ function ShowBulk()
}
return false;
}
?>
?>