Fix expand/collapse all entries
| @@ -12051,6 +12051,7 @@ jQuery(async function () { | |||
| 12051 | const drawerContent = drawer.find('>.inline-drawer-content'); | 12051 | const drawerContent = drawer.find('>.inline-drawer-content'); |
| 12052 | icon.toggleClass('down up'); | 12052 | icon.toggleClass('down up'); |
| 12053 | icon.toggleClass('fa-circle-chevron-down fa-circle-chevron-up'); | 12053 | icon.toggleClass('fa-circle-chevron-down fa-circle-chevron-up'); |
| 12054 | drawer.trigger('inline-drawer-toggle'); | ||
| 12054 | drawerContent.stop().slideToggle({ | 12055 | drawerContent.stop().slideToggle({ |
| 12055 | complete: () => { | 12056 | complete: () => { |
| 12056 | $(this).css('height', ''); | 12057 | $(this).css('height', ''); |
| @@ -2153,20 +2153,22 @@ export function getFreeName(name, list, numberFormatter = (n) => ` #${n}`) { | |||
| 2153 | */ | 2153 | */ |
| 2154 | export function toggleDrawer(drawer, expand = true) { | 2154 | export function toggleDrawer(drawer, expand = true) { |
| 2155 | /** @type {HTMLElement} */ | 2155 | /** @type {HTMLElement} */ |
| 2156 | const icon = drawer.querySelector('.inline-drawer-icon'); | 2156 | const icon = drawer.querySelector(':scope > .inline-drawer-header .inline-drawer-icon'); |
| 2157 | /** @type {HTMLElement} */ | 2157 | /** @type {HTMLElement} */ |
| 2158 | const content = drawer.querySelector('.inline-drawer-content'); | 2158 | const content = drawer.querySelector(':scope > .inline-drawer-content'); |
| 2159 | 2159 | ||
| 2160 | if (expand) { | 2160 | if (expand) { |
| 2161 | icon.classList.remove('up', 'fa-circle-chevron-up'); | ||
| 2162 | icon.classList.add('down', 'fa-circle-chevron-down'); | ||
| 2163 | content.style.display = 'block'; | ||
| 2164 | } else { | ||
| 2165 | icon.classList.remove('down', 'fa-circle-chevron-down'); | 2161 | icon.classList.remove('down', 'fa-circle-chevron-down'); |
| 2166 | icon.classList.add('up', 'fa-circle-chevron-up'); | 2162 | icon.classList.add('up', 'fa-circle-chevron-up'); |
| 2163 | content.style.display = 'block'; | ||
| 2164 | } else { | ||
| 2165 | icon.classList.remove('up', 'fa-circle-chevron-up'); | ||
| 2166 | icon.classList.add('down', 'fa-circle-chevron-down'); | ||
| 2167 | content.style.display = 'none'; | 2167 | content.style.display = 'none'; |
| 2168 | } | 2168 | } |
| 2169 | 2169 | ||
| 2170 | drawer.dispatchEvent(new CustomEvent('inline-drawer-toggle', { bubbles: true })); | ||
| 2171 | |||
| 2170 | // Set the height of "autoSetHeight" textareas within the inline-drawer to their scroll height | 2172 | // Set the height of "autoSetHeight" textareas within the inline-drawer to their scroll height |
| 2171 | if (!CSS.supports('field-sizing', 'content')) { | 2173 | if (!CSS.supports('field-sizing', 'content')) { |
| 2172 | content.querySelectorAll('textarea.autoSetHeight').forEach(resetScrollHeight); | 2174 | content.querySelectorAll('textarea.autoSetHeight').forEach(resetScrollHeight); |
| @@ -3034,7 +3034,7 @@ export async function getWorldEntry(name, data, entry) { | |||
| 3034 | 3034 | ||
| 3035 | let drawerInitialized = false; | 3035 | let drawerInitialized = false; |
| 3036 | let drawerDestroyTimeout = null; | 3036 | let drawerDestroyTimeout = null; |
| 3037 | headerTemplate.find('.inline-drawer-toggle').on('click', function () { | 3037 | headerTemplate.find('.inline-drawer').on('inline-drawer-toggle', function () { |
| 3038 | if (drawerDestroyTimeout) { | 3038 | if (drawerDestroyTimeout) { |
| 3039 | clearTimeout(drawerDestroyTimeout); | 3039 | clearTimeout(drawerDestroyTimeout); |
| 3040 | drawerDestroyTimeout = null; | 3040 | drawerDestroyTimeout = null; |
| @@ -3047,6 +3047,7 @@ export async function getWorldEntry(name, data, entry) { | |||
| 3047 | } | 3047 | } |
| 3048 | drawerInitialized = false; | 3048 | drawerInitialized = false; |
| 3049 | clearEntryList(editOutlet); | 3049 | clearEntryList(editOutlet); |
| 3050 | drawerDestroyTimeout = null; | ||
| 3050 | }, debounce_timeout.relaxed); | 3051 | }, debounce_timeout.relaxed); |
| 3051 | } else { | 3052 | } else { |
| 3052 | drawerInitialized = true; | 3053 | drawerInitialized = true; |