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