mirror of
https://github.com/signynt/virtual-content.git
synced 2026-07-22 05:46:44 +00:00
Fixed flex creating a large gap between the footer and the contents
This commit is contained in:
parent
0be0da594b
commit
c177259ded
2 changed files with 19 additions and 9 deletions
22
main.ts
22
main.ts
|
|
@ -23,17 +23,23 @@ export default class VirtualFooterPlugin extends Plugin {
|
|||
await this.injectFooterToPreview(view);
|
||||
} else if (state.mode === 'source' && !state.source) {
|
||||
// Remove the padding from the content area to append the footer
|
||||
const cmContent = view.containerEl.querySelector('.cm-editor .cm-content') as HTMLDivElement;
|
||||
if (cmContent) {
|
||||
cmContent.classList.add('virtual-footer-cm-padding');
|
||||
}
|
||||
const [content, container] = [
|
||||
view.containerEl.querySelector('.cm-editor .cm-content'),
|
||||
view.containerEl.querySelector('.markdown-source-view.mod-cm6 .cm-contentContainer')
|
||||
] as HTMLDivElement[];
|
||||
content?.classList.add('virtual-footer-cm-padding');
|
||||
container?.classList.add('virtual-footer-remove-flex');
|
||||
|
||||
await this.injectFooterToEditor(view);
|
||||
} else {
|
||||
// Remove the custom styling from the content area
|
||||
const cmContent = view.containerEl.querySelector('.cm-editor .cm-content') as HTMLDivElement;
|
||||
if (cmContent) {
|
||||
cmContent.classList.remove('virtual-footer-cm-padding');
|
||||
}
|
||||
const [content, container] = [
|
||||
view.containerEl.querySelector('.cm-editor .cm-content'),
|
||||
view.containerEl.querySelector('.markdown-source-view.mod-cm6 .cm-contentContainer')
|
||||
] as HTMLDivElement[];
|
||||
content?.classList.remove('virtual-footer-cm-padding');
|
||||
container?.classList.remove('virtual-footer-remove-flex');
|
||||
|
||||
await this.removeFooter(view);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,4 +6,8 @@
|
|||
|
||||
.virtual-footer-cm-padding {
|
||||
padding-bottom: var(--p-spacing) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.virtual-footer-remove-flex {
|
||||
flex: 0 1 auto !important;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue