mirror of
https://github.com/eatcodeplay/obsidian-simple-banner.git
synced 2026-07-22 05:48:13 +00:00
fix: inline title/autohide should get along now
This commit is contained in:
parent
6c2dc23a11
commit
5a79baa8f2
4 changed files with 17 additions and 8 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "simple-banner",
|
||||
"name": "Simple Banner",
|
||||
"version": "0.5.3",
|
||||
"version": "0.5.4",
|
||||
"minAppVersion": "1.8.9",
|
||||
"description": "Visually enhance your notes with a customizable banner. Supports icons and time/date display.",
|
||||
"author": "Sandro Ducceschi",
|
||||
|
|
|
|||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "simple-banner",
|
||||
"version": "0.5.3",
|
||||
"version": "0.5.4",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "simple-banner",
|
||||
"version": "0.5.3",
|
||||
"version": "0.5.4",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/node": "^16.11.6",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "simple-banner",
|
||||
"version": "0.5.3",
|
||||
"version": "0.5.4",
|
||||
"description": "Visually enhance your notes with a customizable banner. Supports icons and time/date display.",
|
||||
"main": "dist/main.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
17
src/main.ts
17
src/main.ts
|
|
@ -205,6 +205,15 @@ export default class SimpleBanner extends Plugin {
|
|||
targets.forEach((t) => {
|
||||
t.remove()
|
||||
});
|
||||
|
||||
if (this.settings.properties.autohide) {
|
||||
const inline = document.querySelector('.inline-title');
|
||||
const meta = document.querySelector('.metadata-container');
|
||||
if (inline && meta) {
|
||||
inline.after(meta);
|
||||
}
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
Store.delete(view?.leaf.id);
|
||||
delete container.dataset.sb;
|
||||
|
|
@ -291,10 +300,10 @@ export default class SimpleBanner extends Plugin {
|
|||
const view = this.getActiveView();
|
||||
if (view) {
|
||||
if (this.settings.properties.autohide) {
|
||||
const propsContainer = document.querySelector('.metadata-container');
|
||||
const parent = propsContainer?.parentNode;
|
||||
if (parent && parent.firstChild !== propsContainer) {
|
||||
parent.prepend(propsContainer);
|
||||
const inline = document.querySelector('.inline-title');
|
||||
const meta = document.querySelector('.metadata-container');
|
||||
if (inline && meta) {
|
||||
inline.before(meta);
|
||||
}
|
||||
}
|
||||
// @ts-ignore
|
||||
|
|
|
|||
Loading…
Reference in a new issue