use Platform.isDesktop for minimum width

This commit is contained in:
Ell 2022-03-23 11:45:08 +01:00
parent 5a6bf176e7
commit c7d6ee8702

14
main.ts
View file

@ -102,14 +102,14 @@ class CustomFrameView extends ItemView {
`);
}
}
}
if (this.frame.minimumWidth) {
let parent = this.contentEl.closest<HTMLElement>(".workspace-split.mod-horizontal");
if (parent) {
let minWidth = `${this.frame.minimumWidth + 2 * this.settings.padding}px`;
if (parent.style.width < minWidth)
parent.style.width = minWidth;
}
if (Platform.isDesktop && this.frame.minimumWidth) {
let parent = this.contentEl.closest<HTMLElement>(".workspace-split.mod-horizontal");
if (parent) {
let minWidth = `${this.frame.minimumWidth + 2 * this.settings.padding}px`;
if (parent.style.width < minWidth)
parent.style.width = minWidth;
}
}
};