mirror of
https://github.com/eatcodeplay/obsidian-simple-banner.git
synced 2026-07-22 05:48:13 +00:00
fixed: prevent banners in inline/embedded notes
This commit is contained in:
parent
ec6b43fa19
commit
7ec18abb0d
5 changed files with 11 additions and 6 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "simple-banner",
|
||||
"name": "Simple Banner",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"minAppVersion": "1.8.9",
|
||||
"description": "Simply add a banner image.",
|
||||
"author": "Sandro Ducceschi",
|
||||
|
|
|
|||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "simple-banner",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "simple-banner",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/lodash": "^4.17.16",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "simple-banner",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"description": "Simply add a banner image",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ export default class SimpleBanner extends Plugin {
|
|||
if (lastViewMode !== viewMode || isNewValue) {
|
||||
if (container && isNewValue) {
|
||||
const view = this.getActiveView();
|
||||
const containers = container.querySelectorAll('.markdown-preview-view, .cm-scroller');
|
||||
const containers = container.querySelectorAll('.markdown-reading-view > .markdown-preview-view, .cm-scroller');
|
||||
containers.forEach((c) => {
|
||||
let element = (c.querySelector('.simple-banner') || document.createElement('div')) as HTMLElement;
|
||||
element.classList.add('simple-banner');
|
||||
|
|
|
|||
|
|
@ -104,13 +104,18 @@
|
|||
z-index: 1;
|
||||
padding-top: calc(var(--smpbn-height, 240px) + (var(--smpbn-note-offset) - 6px));
|
||||
}
|
||||
|
||||
.el-pre.mod-frontmatter.mod-ui {
|
||||
padding-top: calc(var(--smpbn-height, 240px) + (var(--smpbn-note-offset) + 12px));
|
||||
}
|
||||
|
||||
.inline-embed .el-pre.mod-frontmatter.mod-ui {
|
||||
padding-top: initial;
|
||||
}
|
||||
}
|
||||
|
||||
body.show-inline-title .workspace-leaf-content[data-sb] .view-content > .markdown-source-view.mod-cm6 > .cm-editor > .cm-scroller,
|
||||
body.show-inline-title .workspace-leaf-content[data-sb] .view-content .markdown-preview-view {
|
||||
body.show-inline-title .workspace-leaf-content[data-sb] .view-content > .markdown-preview-view {
|
||||
.cm-contentContainer {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue