fixes(imagePreview): & toggle setting

This commit is contained in:
Creation's 2024-11-02 00:18:12 -04:00 committed by GitHub
parent a16f241b85
commit bfda6a5c26
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 4 deletions

View file

@ -263,8 +263,10 @@ function loadImagePreview(url: string, sticker: boolean) {
fileSize.appendChild(showingSize);
}
preview.appendChild(fileName);
preview.appendChild(fileInfo);
if (settings.store.fileInformation) {
preview.appendChild(fileName);
preview.appendChild(fileInfo);
}
});
if (loadingSpinner) loadingSpinner.remove();
@ -287,7 +289,7 @@ function loadImagePreview(url: string, sticker: boolean) {
}
});
currentPreview.addEventListener("mouseout", () => {
currentPreviewFile.addEventListener("mouseout", () => {
if (currentPreview && !isCtrlHeld && shouldKeepPreviewOpen) {
deleteCurrentPreview();
shouldKeepPreviewOpen = false;

View file

@ -43,6 +43,11 @@ const settings = definePluginSettings({
description: "Fixes the image preview to the initial point of hover",
default: false
},
fileInformation: {
type: OptionType.BOOLEAN,
description: "Show file information on hover",
default: true
},
hoverDelay: {
type: OptionType.SLIDER,
description: "Delay in seconds before the image preview appears",

View file

@ -107,4 +107,4 @@
max-height: 90vh;
object-fit: contain;
display: none;
}
}