From bc611c5e26bf641dbbfbb2854045208e7e15568e Mon Sep 17 00:00:00 2001 From: Max van Essen Date: Thu, 16 Feb 2023 09:37:03 +0100 Subject: [PATCH] Remove deprecated settings --- src/components/Settings/index.ts | 18 +++--------------- src/main.ts | 3 +-- src/ui/ZenView.ts | 3 +-- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/components/Settings/index.ts b/src/components/Settings/index.ts index 65225b4..ae5d7bf 100644 --- a/src/components/Settings/index.ts +++ b/src/components/Settings/index.ts @@ -1,7 +1,6 @@ import {App, ButtonComponent, PluginSettingTab, Setting} from "obsidian"; import {pluginConfig} from "../../plugin.config"; import Zen from "../../main"; -import {VIEW_TYPE_ZEN} from "../../constants"; export class SettingsTab extends PluginSettingTab { plugin: Zen; @@ -67,8 +66,8 @@ export class SettingsTab extends PluginSettingTab { new Setting(containerEl) .setName("Left side-dock") - .addButton(bc => this.highlightElement(bc, ".workspace-split.mod-horizontal.mod-left-split", false, `.workspace-tab-header[data-type='${VIEW_TYPE_ZEN}']`)) - .setDesc("Including the side-dock toggle button(s), except the 'zen-toggle-button'.") + .addButton(bc => this.highlightElement(bc, ".workspace-split.mod-horizontal.mod-left-split", false)) + .setDesc("Including the side-dock toggle button(s).") .addToggle(tc => tc .setValue(this.plugin.settings.preferences.sideDockLeft) .onChange(async (value) => { @@ -91,36 +90,25 @@ export class SettingsTab extends PluginSettingTab { ); } - highlightElement(c: ButtonComponent, el: string, isAbsolute: boolean = false, exceptionEls: string|null = null) { + highlightElement(c: ButtonComponent, el: string, isAbsolute: boolean = false) { //Status bar is outside of this.app.workspace.containerEl const element = document.body.find(el); - const exceptionElements = exceptionEls && document.querySelectorAll(exceptionEls); const highlightClass = isAbsolute ? "zen-highlight-el-ab" : "zen-highlight-el"; - const exceptionClass = "zen-highlight-el--exception"; c.setIcon("eye"); c.setTooltip("Highlight"); c.buttonEl.addEventListener("mousedown", () => { element?.classList.add(highlightClass); - exceptionElements && exceptionElements.forEach((sEl) =>{ - sEl.classList.add(exceptionClass); - }) }); c.buttonEl.addEventListener("mouseup", () => { element?.classList.remove(highlightClass); - exceptionElements && exceptionElements.forEach((sEl) =>{ - sEl.classList.remove(exceptionClass); - }) }); c.buttonEl.addEventListener("mouseleave", () => { element?.classList.remove(highlightClass); - exceptionElements && exceptionElements.forEach((sEl) =>{ - sEl.classList.remove(exceptionClass); - }) }); } } diff --git a/src/main.ts b/src/main.ts index 62808f5..23a2268 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,7 +1,6 @@ import { MarkdownView, - Plugin, - WorkspaceLeaf + Plugin } from 'obsidian'; import {DEFAULT_SETTINGS, Settings} from "./utils/types"; import {SettingsTab} from "./components/Settings"; diff --git a/src/ui/ZenView.ts b/src/ui/ZenView.ts index 0d12ff0..8d7fc32 100644 --- a/src/ui/ZenView.ts +++ b/src/ui/ZenView.ts @@ -1,7 +1,6 @@ -import {getIcon, Menu, setIcon, View, WorkspaceLeaf} from "obsidian"; +import {getIcon, setIcon, View, WorkspaceLeaf} from "obsidian"; import {VIEW_TYPE_ZEN} from "../constants"; import Zen from "../main"; -import {pluginConfig} from "../plugin.config"; export class ZenLeaf extends WorkspaceLeaf{