Fix scrolling and width of global WI

This commit is contained in:
Cohee
2023-06-25 12:43:37 +03:00
parent 861e0d017e
commit 951e22ac8e
2 changed files with 12 additions and 6 deletions

View File

@@ -1876,9 +1876,9 @@
</div>
<div id="wi-holder" class="margin5">
<div class="justifyContentSpaceAround wi-settings flex-container gap10px alignitemscenter">
<div id="WIMultiSelector" class="flex alignSelfStart range-block">
<div id="WIMultiSelector" class="flex2 flex alignSelfStart range-block">
<div class="range-block-title justifyLeft">
<small>Active World</small>
<small>Active World(s)</small>
</div>
<div class="range-block-range">
<select id="world_info" multiple>
@@ -1886,7 +1886,7 @@
</select>
</div>
</div>
<div class=" flex-container flexFlowColumn">
<div class="flex2 flex-container flexFlowColumn">
<div class="flex range-block">
<div class="range-block-title justifyLeft">
<label for="world_info_character_strategy">
@@ -1937,7 +1937,7 @@
</div>
</div>
<div class="range-block flex-container flexFlowColumn">
<div class="flex1 range-block flex-container flexFlowColumn">
<label title="Entries can activate other entries by mentioning their keywords" class="checkbox_label">
<input id="world_info_recursive" type="checkbox" />
<small>

View File

@@ -1081,12 +1081,18 @@ jQuery(() => {
$(document).ready(function () {
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 (deviceInfo.device.type === 'desktop') {
e.preventDefault();
const option = $(e.target);
const selectElement = $(this)[0];
selectScrollTop = selectElement.scrollTop;
option.prop('selected', !option.prop('selected'));
await delay(1);
selectElement.scrollTop = selectScrollTop;
}
onWorldInfoChange('__notSlashCommand__');