From ae20990e9103c0e55f60f1dc0b13f1be01e3d5a2 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Tue, 8 Oct 2024 12:02:32 +0200 Subject: [PATCH] misc tweak --- changedetectionio/static/js/toggle-theme.js | 4 ++-- changedetectionio/static/js/watch-settings.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/changedetectionio/static/js/toggle-theme.js b/changedetectionio/static/js/toggle-theme.js index b4fc40a6..db6208db 100644 --- a/changedetectionio/static/js/toggle-theme.js +++ b/changedetectionio/static/js/toggle-theme.js @@ -49,9 +49,9 @@ $(document).ready(function () { $("#overlay").toggleClass('visible'); heartpath.style.fill = document.getElementById("overlay").classList.contains("visible") ? '#ff0000' : 'var(--color-background)'; }); - + setInterval(function () { $('body').toggleClass('spinner-active', $.active > 0); - }, 250); // Checks every 250 milliseconds + }, 2000); }); diff --git a/changedetectionio/static/js/watch-settings.js b/changedetectionio/static/js/watch-settings.js index 0b154055..d7fc3b58 100644 --- a/changedetectionio/static/js/watch-settings.js +++ b/changedetectionio/static/js/watch-settings.js @@ -25,14 +25,15 @@ function request_textpreview_update() { const name = $element.attr('name'); // Get the name attribute of the element data[name] = $element.is(':checkbox') ? ($element.is(':checked') ? $element.val() : false) : $element.val(); }); - $('#text-preview-spinner').show(); + + $('body').toggleClass('spinner-active', 1); + $.abortiveSingularAjax({ type: "POST", url: preview_text_edit_filters_url, data: data, namespace: 'watchEdit' }).done(function (data) { - $('#text-preview-spinner').fadeOut(); $('#filters-and-triggers #text-preview-before-inner').text(data['before_filter']); $('#filters-and-triggers #text-preview-inner') .text(data['after_filter']) @@ -43,7 +44,6 @@ function request_textpreview_update() { } ]); }).fail(function (error) { - $('#text-preview-spinner').fadeOut(); if (error.statusText === 'abort') { console.log('Request was aborted due to a new request being fired.'); } else {