Stop mass WI open if the page was unloaded
| @@ -1943,12 +1943,15 @@ function updateWorldEntryKeyOptionsCache(keyOptions, { remove = false, reset = f | ||
| 1943 | 1943 | function clearEntryList($list) { |
| 1944 | 1944 | console.time('clearEntryList'); |
| 1945 | 1945 | |
| 1946 | + // List already empty, skipping cleanup | |
| 1946 | 1947 | if (!$list.children().length) { |
| 1947 | - console.debug('List already empty, skipping cleanup.'); | |
| 1948 | 1948 | console.timeEnd('clearEntryList'); |
| 1949 | 1949 | return; |
| 1950 | 1950 | } |
| 1951 | 1951 | |
| 1952 | + // Unsubscribe from toggle events, so that mass open won't create new drawers | |
| 1953 | + $list.find('.inline-drawer').off('inline-drawer-toggle'); | |
| 1954 | + | |
| 1952 | 1955 | // Step 1: Clean all <option> elements within <select> |
| 1953 | 1956 | $list.find('option').each(function () { |
| 1954 | 1957 | const $option = $(this); |
| @@ -2873,6 +2876,9 @@ function handleEntryKillSwitchHelper({ entryKillSwitch, entry, data, name, setWI | ||
| 2873 | 2876 | |
| 2874 | 2877 | /** |
| 2875 | 2878 | * Main function to build the WI entry editor template. |
| 2879 | + * @param {string} name - The name of the world info file. | |
| 2880 | + * @param {object} data - The world info data object. | |
| 2881 | + * @param {object} entry - The entry object to be edited. | |
| 2876 | 2882 | */ |
| 2877 | 2883 | export async function getWorldEntry(name, data, entry) { |
| 2878 | 2884 | if (!data.entries[entry.uid]) return; |