mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Restore logic to avoid live poll on pages that don't have the button
This commit is contained in:
parent
767217133e
commit
5e295b0a88
1 changed files with 19 additions and 16 deletions
|
@ -41,7 +41,9 @@ ready(() => {
|
|||
|
||||
updateFuzzyTimes();
|
||||
|
||||
document.querySelectorAll(".live-poll").forEach(node => {
|
||||
var buttons = document.querySelectorAll(".live-poll");
|
||||
if (buttons.length > 0) {
|
||||
buttons.forEach(node => {
|
||||
node.addEventListener("click", event => {
|
||||
if (localStorage.sidekiqLivePoll == "enabled") {
|
||||
localStorage.sidekiqLivePoll = "disabled";
|
||||
|
@ -60,6 +62,7 @@ ready(() => {
|
|||
if (localStorage.sidekiqLivePoll == "enabled") {
|
||||
scheduleLivePoll();
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
function updateFuzzyTimes() {
|
||||
|
|
Loading…
Reference in a new issue