From 5af6874b5f8eda9b5fa27c15dad9042f63ab1f81 Mon Sep 17 00:00:00 2001 From: Cohee Date: Thu, 29 Jun 2023 18:22:14 +0300 Subject: [PATCH] Restyle Global WI selector --- public/scripts/world-info.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index 90218cd17..79f02d223 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -1261,7 +1261,6 @@ jQuery(() => { registerSlashCommand('world', onWorldInfoChange, [], "– sets active World, or unsets if no args provided", true, true); }) - let selectScrollTop = null; $("#world_info").on('mousedown change', async function (e) { // If there's no world names, don't do anything @@ -1270,7 +1269,9 @@ jQuery(() => { return; } + /* if (deviceInfo.device.type === 'desktop') { + let selectScrollTop = null; e.preventDefault(); const option = $(e.target); const selectElement = $(this)[0]; @@ -1279,6 +1280,7 @@ jQuery(() => { await delay(1); selectElement.scrollTop = selectScrollTop; } + */ onWorldInfoChange('__notSlashCommand__'); }); @@ -1371,6 +1373,7 @@ jQuery(() => { } }); + /* $("#world_info").on('mousewheel', function (e) { e.preventDefault(); if ($(this).is(':animated')) { @@ -1386,5 +1389,15 @@ jQuery(() => { $(this).animate({ scrollTop: scrollTop }, 200); }); + */ + // Not needed on mobile + if (deviceInfo.device.type === 'desktop') { + $('#world_info').select2({ + width: '100%', + placeholder: 'No Worlds active. Click here to select.', + allowClear: true, + closeOnSelect: false, + }); + } })