From 5d60897cfa4f57657ed556e0b1abe4d240fe86b2 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Sun, 29 Sep 2024 01:00:56 +0300 Subject: [PATCH] Fix drawer icon not changing on WI --- public/script.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/script.js b/public/script.js index c15b1a5f3..6d93bc03b 100644 --- a/public/script.js +++ b/public/script.js @@ -10727,10 +10727,12 @@ jQuery(async function () { if ($(e.target).hasClass('text_pole')) { return; } - var icon = $(this).find('.inline-drawer-icon'); + const drawer = $(this).closest('.inline-drawer'); + const icon = drawer.find('.inline-drawer-icon'); + const drawerContent = drawer.find('.inline-drawer-content'); icon.toggleClass('down up'); icon.toggleClass('fa-circle-chevron-down fa-circle-chevron-up'); - $(this).closest('.inline-drawer').find('.inline-drawer-content').stop().slideToggle({ + drawerContent.stop().slideToggle({ complete: () => { $(this).css('height', ''); }, @@ -10738,7 +10740,7 @@ jQuery(async function () { // Set the height of "autoSetHeight" textareas within the inline-drawer to their scroll height if (!CSS.supports('field-sizing', 'content')) { - $(this).closest('.inline-drawer').find('.inline-drawer-content textarea.autoSetHeight').each(async function () { + drawerContent.find('textarea.autoSetHeight').each(async function () { await resetScrollHeight($(this)); return; });