Less horrible charListGrid load
This commit is contained in:
parent
75c6bee350
commit
3e3597673b
|
@ -8879,9 +8879,8 @@ const isPwaMode = window.navigator.standalone;
|
||||||
if (isPwaMode) { $('body').addClass('PWA'); }
|
if (isPwaMode) { $('body').addClass('PWA'); }
|
||||||
|
|
||||||
function doCharListDisplaySwitch() {
|
function doCharListDisplaySwitch() {
|
||||||
console.debug('toggling body charListGrid state');
|
power_user.charListGrid = !power_user.charListGrid;
|
||||||
$('body').toggleClass('charListGrid');
|
document.body.classList.toggle('charListGrid', power_user.charListGrid);
|
||||||
power_user.charListGrid = $('body').hasClass('charListGrid') ? true : false;
|
|
||||||
saveSettingsDebounced();
|
saveSettingsDebounced();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,7 @@ export const persona_description_positions = {
|
||||||
};
|
};
|
||||||
|
|
||||||
let power_user = {
|
let power_user = {
|
||||||
|
charListGrid: false,
|
||||||
tokenizer: tokenizers.BEST_MATCH,
|
tokenizer: tokenizers.BEST_MATCH,
|
||||||
token_padding: 64,
|
token_padding: 64,
|
||||||
collapse_newlines: false,
|
collapse_newlines: false,
|
||||||
|
@ -1602,18 +1603,8 @@ async function loadPowerUserSettings(settings, data) {
|
||||||
loadCharListState();
|
loadCharListState();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadCharListState() {
|
function loadCharListState() {
|
||||||
if (document.querySelector('.character_select') !== null) {
|
document.body.classList.toggle('charListGrid', power_user.charListGrid);
|
||||||
console.debug('setting charlist state to...');
|
|
||||||
if (power_user.charListGrid === true) {
|
|
||||||
console.debug('..to grid');
|
|
||||||
$('#charListGridToggle').trigger('click');
|
|
||||||
} else { console.debug('..to list'); }
|
|
||||||
} else {
|
|
||||||
console.debug('charlist not ready yet');
|
|
||||||
await delay(100);
|
|
||||||
loadCharListState();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadMovingUIState() {
|
function loadMovingUIState() {
|
||||||
|
|
Loading…
Reference in New Issue