Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed a Couple of SettingsTab Properties to Try to Fix Navigation Menu Issues #566

Merged
merged 3 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-linter",
"name": "Linter",
"version": "1.10.0",
"version": "1.10.1",
"minAppVersion": "0.15.6",
"description": "Formats and styles your notes. It can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular markdown contents like list, italics, and bold styles; and more with the use of custom rule options as well.",
"author": "Victor Tao",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "obsidian-linter",
"version": "1.10.0",
"version": "1.10.1",
"description": "Enforces consistent markdown styling for Obsidian (https://obsidian.md). It can be used to format YAML tags, aliases, arrays, and metadata; footnotes; headings; spacing; math blocks; regular markdown contents like list, italics, and bold styles; and more with the use of custom rule options as well.",
"main": "main.js",
"scripts": {
Expand Down
20 changes: 9 additions & 11 deletions src/ui/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {DebugTab} from './linter-components/tab-components/debug-tab';
export class SettingTab extends PluginSettingTab {
plugin: LinterPlugin;
navContainer: HTMLElement;
navEl: HTMLDivElement;
settingsEl: HTMLDivElement;
tabNavEl: HTMLDivElement;
settingsContentEl: HTMLDivElement;
private tabNameToTab: Map<string, Tab> = new Map<string, Tab>();
private selectedTab: string = 'General';
private searchZeroState: HTMLDivElement;
Expand All @@ -28,7 +28,6 @@ export class SettingTab extends PluginSettingTab {
const {containerEl} = this;

containerEl.empty();

const linterHeader = containerEl.createDiv('linter-setting-title');
if (Platform.isMobile) {
linterHeader.addClass('linter-mobile');
Expand All @@ -37,9 +36,8 @@ export class SettingTab extends PluginSettingTab {
}

this.navContainer = containerEl.createEl('nav', {cls: 'linter-setting-header'});
this.navEl = this.navContainer.createDiv('linter-setting-tab-group');
this.settingsEl = containerEl.createDiv('linter-setting-content');

this.tabNavEl = this.navContainer.createDiv('linter-setting-tab-group');
this.settingsContentEl = containerEl.createDiv('linter-setting-content');
this.addTabs(Platform.isMobile);
this.createSearchZeroState(Platform.isMobile);
this.generateSearchBar(linterHeader);
Expand All @@ -50,14 +48,14 @@ export class SettingTab extends PluginSettingTab {
}

private addTabs(isMobile: boolean) {
this.addTab(new GeneralTab(this.navEl, this.settingsEl, isMobile, this.plugin));
this.addTab(new GeneralTab(this.tabNavEl, this.settingsContentEl, isMobile, this.plugin));

for (const ruleType of Object.values(RuleType)) {
this.addTab(new RuleTab(this.navEl, this.settingsEl, ruleType, ruleTypeToRules.get(ruleType), isMobile, this.plugin));
this.addTab(new RuleTab(this.tabNavEl, this.settingsContentEl, ruleType, ruleTypeToRules.get(ruleType), isMobile, this.plugin));
}

this.addTab(new CustomTab(this.navEl, this.settingsEl, isMobile, this.app, this.plugin));
this.addTab(new DebugTab(this.navEl, this.settingsEl, isMobile, this.plugin));
this.addTab(new CustomTab(this.tabNavEl, this.settingsContentEl, isMobile, this.app, this.plugin));
this.addTab(new DebugTab(this.tabNavEl, this.settingsContentEl, isMobile, this.plugin));
}

private generateSearchBar(containerEl: HTMLDivElement) {
Expand All @@ -76,7 +74,7 @@ export class SettingTab extends PluginSettingTab {
}

private createSearchZeroState(isMobile: boolean) {
this.searchZeroState = this.settingsEl.createDiv();
this.searchZeroState = this.settingsContentEl.createDiv();
hideEl(this.searchZeroState);
this.searchZeroState.createEl(isMobile ? 'h3' : 'h2', {text: 'No settings match search'}).style.textAlign = 'center';
}
Expand Down
1 change: 1 addition & 0 deletions versions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"1.10.1": "0.15.6",
"1.10.0": "0.15.6",
"1.9.1": "0.15.6",
"1.9.0": "0.15.6",
Expand Down