Skip to content

Instantly share code, notes, and snippets.

@messutied
Last active September 29, 2020 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save messutied/fd2cd7f56c8ba0d381fb0408800a3c8a to your computer and use it in GitHub Desktop.
Save messutied/fd2cd7f56c8ba0d381fb0408800a3c8a to your computer and use it in GitHub Desktop.
This JS snipped makes the subscription modal in a Statuspal status page to open with the "Select services" option checked by default.
document.addEventListener("DOMContentLoaded", function() {
var $ = document.querySelector.bind(document);
var subButton = $('.subscribe');
var input = $('[name="subscription[filter]"][value="services"]');
subButton.addEventListener('click', function () {
setTimeout(function () {
input.checked = true;
input.dispatchEvent(new Event('change'));
}, 0);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment