From 4beab19f45c9bc83e9bb8045b2eb384e48f37c39 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sat, 28 Sep 2024 10:08:23 +0200 Subject: [PATCH] UI tweaks --- changedetectionio/static/js/watch-settings.js | 6 ++++++ changedetectionio/templates/edit.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/changedetectionio/static/js/watch-settings.js b/changedetectionio/static/js/watch-settings.js index 34e50d1b..0a6c96c4 100644 --- a/changedetectionio/static/js/watch-settings.js +++ b/changedetectionio/static/js/watch-settings.js @@ -33,6 +33,10 @@ function toggleOpacity(checkboxSelector, fieldSelector, inverted) { })(jQuery); function request_textpreview_update() { + if (!$('body').hasClass('preview-text-enabled')) { + return + } + const data = {}; $('textarea:visible, input:visible').each(function () { const $element = $(this); // Cache the jQuery object for the current element @@ -80,11 +84,13 @@ $(document).ready(function () { $('body').toggleClass('preview-text-enabled') request_textpreview_update(); + $("#text-preview-refresh").click(function (e) { request_textpreview_update(); }); $('textarea:visible').on('keyup blur', debounced_request_textpreview_update); $('input:visible').on('keyup blur change', debounced_request_textpreview_update); + $("#filters-and-triggers-tab").on('click', debounced_request_textpreview_update); }); }); diff --git a/changedetectionio/templates/edit.html b/changedetectionio/templates/edit.html index 76cd4195..2d0014b9 100644 --- a/changedetectionio/templates/edit.html +++ b/changedetectionio/templates/edit.html @@ -50,7 +50,7 @@ {% endif %} {% if watch['processor'] == 'text_json_diff' %}
  • Visual Filter Selector
  • -
  • Filters & Triggers
  • +
  • Filters & Triggers
  • {% endif %}
  • Notifications
  • Stats