add tooltip, efficient-ify class toggling
This commit is contained in:
parent
e77dd96bb7
commit
d7d99fa94c
|
@ -5302,7 +5302,7 @@
|
|||
<span class="drag-handle">☰</span>
|
||||
<div class="gap5px world_entry_thin_controls wide100p alignitemscenter">
|
||||
<div class="inline-drawer-toggle fa-fw fa-solid fa-circle-chevron-down inline-drawer-icon down"></div>
|
||||
<div class="fa-solid fa-toggle-on killSwitch" name="entryKillSwitch"></div>
|
||||
<div class="fa-solid fa-toggle-on killSwitch" name="entryKillSwitch" title="Toggle entry's active state."></div>
|
||||
<div class="flex-container alignitemscenter wide100p">
|
||||
|
||||
<div class="WIEntryTitleAndStatus flex-container flex1 alignitemscenter">
|
||||
|
|
|
@ -2920,15 +2920,9 @@ async function getWorldEntry(name, data, entry) {
|
|||
data.entries[uid].disable = !data.entries[uid].disable;
|
||||
let isActive = !data.entries[uid].disable;
|
||||
setWIOriginalDataValue(data, uid, 'enabled', isActive);
|
||||
if (isActive) {
|
||||
template.removeClass('disabledWIEntry');
|
||||
entryKillSwitch.removeClass('fa-toggle-off');
|
||||
entryKillSwitch.addClass('fa-toggle-on');
|
||||
} else {
|
||||
template.addClass('disabledWIEntry');
|
||||
entryKillSwitch.addClass('fa-toggle-off');
|
||||
entryKillSwitch.removeClass('fa-toggle-on');
|
||||
}
|
||||
template.toggleClass('disabledWIEntry', !isActive);
|
||||
entryKillSwitch.toggleClass('fa-toggle-off', !isActive);
|
||||
entryKillSwitch.toggleClass('fa-toggle-on', isActive);
|
||||
await saveWorldInfo(name, data);
|
||||
|
||||
});
|
||||
|
@ -2947,17 +2941,9 @@ async function getWorldEntry(name, data, entry) {
|
|||
};
|
||||
|
||||
const isActive = !entry.disable;
|
||||
if (isActive) {
|
||||
console.warn(`${entry.uid} is active`);
|
||||
template.removeClass('disabledWIEntry');
|
||||
entryKillSwitch.removeClass('fa-toggle-off');
|
||||
entryKillSwitch.addClass('fa-toggle-on');
|
||||
} else {
|
||||
console.warn(`${entry.uid} is not active`);
|
||||
template.addClass('disabledWIEntry');
|
||||
entryKillSwitch.addClass('fa-toggle-off');
|
||||
entryKillSwitch.removeClass('fa-toggle-on');
|
||||
}
|
||||
template.toggleClass('disabledWIEntry', !isActive);
|
||||
entryKillSwitch.toggleClass('fa-toggle-off', !isActive);
|
||||
entryKillSwitch.toggleClass('fa-toggle-on', isActive);
|
||||
|
||||
template
|
||||
.find(`select[name="entryStateSelector"] option[value=${entryState()}]`)
|
||||
|
|
Loading…
Reference in New Issue