From f0e76fe64b5f4d114be24ab7068e08d43e168849 Mon Sep 17 00:00:00 2001 From: 2Abendsegler <2Abendsegler@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:51:55 +0200 Subject: [PATCH] [Log Form] Log template "Last Cache-Log" inserts old Log instead of last one #2542 --- gc_little_helper_II.user.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gc_little_helper_II.user.js b/gc_little_helper_II.user.js index daac7928..f50d5b4c 100644 --- a/gc_little_helper_II.user.js +++ b/gc_little_helper_II.user.js @@ -5120,9 +5120,9 @@ var mainGC = function() { // Save last log text. function saveLastLog() {setValue("last_logtext", $('#gc-md-editor_md')[0].value);} function buildClickForSaveLastLog(waitCount) { - if ($('button.submit-button')[0] && !$('button.submit-button.gclh_build_click')[0]) { - $('button.submit-button')[0].addEventListener('click', saveLastLog, true); - $('button.submit-button').addClass('gclh_build_click'); + if ($('.post-button-container')[0] && !$('.post-button-container.gclh_save_last_log')[0]) { + $('.post-button-container').bind('click', () => { saveLastLog() }); + $('.post-button-container').addClass('gclh_save_last_log'); } waitCount++; if (waitCount <= 50) setTimeout(function(){buildClickForSaveLastLog(waitCount);}, 200); }