make AN open properly, random typescript fixes
This commit is contained in:
@@ -347,7 +347,7 @@ export function setFloatingPrompt() {
|
||||
}
|
||||
|
||||
if (lastMessageNumber <= 0 || chat_metadata[metadata_keys.interval] <= 0) {
|
||||
context.setExtensionPrompt(MODULE_NAME, '');
|
||||
context.setExtensionPrompt(MODULE_NAME, '', 999, 999);
|
||||
$('#extension_floating_counter').text('(disabled)');
|
||||
shouldWIAddPrompt = false;
|
||||
return;
|
||||
@@ -380,7 +380,7 @@ export function setFloatingPrompt() {
|
||||
}
|
||||
context.setExtensionPrompt(
|
||||
MODULE_NAME,
|
||||
prompt,
|
||||
String(prompt),
|
||||
chat_metadata[metadata_keys.position],
|
||||
chat_metadata[metadata_keys.depth],
|
||||
extension_settings.note.allowWIScan,
|
||||
@@ -396,37 +396,39 @@ function onANMenuItemClick() {
|
||||
}
|
||||
|
||||
//show AN if it's hidden
|
||||
if ($('#floatingPrompt').css('display') !== 'flex') {
|
||||
$('#floatingPrompt').addClass('resizing');
|
||||
$('#floatingPrompt').css('display', 'flex');
|
||||
$('#floatingPrompt').css('opacity', 0.0);
|
||||
$('#floatingPrompt').transition({
|
||||
const $ANcontainer = $('#floatingPrompt');
|
||||
if ($ANcontainer.css('display') !== 'flex') {
|
||||
$ANcontainer.addClass('resizing');
|
||||
$ANcontainer.css('display', 'flex');
|
||||
$ANcontainer.css('opacity', 0.0);
|
||||
$ANcontainer.transition({
|
||||
height: 'unset', //AN gets height: 0 from CSS LN 5363 for .drawer-content
|
||||
opacity: 1.0,
|
||||
duration: animation_duration,
|
||||
}, async function () {
|
||||
await delay(50);
|
||||
$('#floatingPrompt').removeClass('resizing');
|
||||
$ANcontainer.removeClass('resizing');
|
||||
});
|
||||
|
||||
//auto-open the main AN inline drawer
|
||||
if ($('#ANBlockToggle')
|
||||
.siblings('.inline-drawer-content')
|
||||
.css('display') !== 'block') {
|
||||
$('#floatingPrompt').addClass('resizing');
|
||||
$('#ANBlockToggle').click();
|
||||
$ANcontainer.addClass('resizing');
|
||||
$('#ANBlockToggle').trigger('click');
|
||||
}
|
||||
} else {
|
||||
//hide AN if it's already displayed
|
||||
$('#floatingPrompt').addClass('resizing');
|
||||
$('#floatingPrompt').transition({
|
||||
$ANcontainer.addClass('resizing');
|
||||
$ANcontainer.transition({
|
||||
opacity: 0.0,
|
||||
duration: animation_duration,
|
||||
}, async function () {
|
||||
await delay(50);
|
||||
$('#floatingPrompt').removeClass('resizing');
|
||||
$ANcontainer.removeClass('resizing');
|
||||
});
|
||||
setTimeout(function () {
|
||||
$('#floatingPrompt').hide();
|
||||
$ANcontainer.hide();
|
||||
}, animation_duration);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user