mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
#2260 Handle window resize in script editor
This commit is contained in:
@ -342,6 +342,16 @@ export class QuickReply {
|
|||||||
message.addEventListener('scroll', (evt)=>{
|
message.addEventListener('scroll', (evt)=>{
|
||||||
updateScrollDebounced();
|
updateScrollDebounced();
|
||||||
});
|
});
|
||||||
|
/** @type {any} */
|
||||||
|
const resizeListener = debounce((evt) => {
|
||||||
|
updateSyntax();
|
||||||
|
updateScrollDebounced(evt);
|
||||||
|
if (document.activeElement == message) {
|
||||||
|
message.blur();
|
||||||
|
message.focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.addEventListener('resize', resizeListener);
|
||||||
message.style.color = 'transparent';
|
message.style.color = 'transparent';
|
||||||
message.style.background = 'transparent';
|
message.style.background = 'transparent';
|
||||||
message.style.setProperty('text-shadow', 'none', 'important');
|
message.style.setProperty('text-shadow', 'none', 'important');
|
||||||
@ -514,6 +524,8 @@ export class QuickReply {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await popupResult;
|
await popupResult;
|
||||||
|
|
||||||
|
window.removeEventListener('resize', resizeListener);
|
||||||
} else {
|
} else {
|
||||||
warn('failed to fetch qrEditor template');
|
warn('failed to fetch qrEditor template');
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user