Skip to content

Commit

Permalink
Quick test to see if we can infact have dividers on phones
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmcgivery committed Mar 8, 2024
1 parent 6508d58 commit 7410643
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
24 changes: 12 additions & 12 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ export default class DividerPlugin extends Plugin {

// Render the dividers based on what is already in settings
// Don't try to render them on phones since it ends up being a context menu
if (
/*if (
// @ts-ignore
!(this.app.isMobile && document.body.classList.contains("is-phone"))
) {
Object.keys(this.settings.dividers).forEach((dividerId) => {
const divider = this.settings.dividers[dividerId];
) {*/
Object.keys(this.settings.dividers).forEach((dividerId) => {
const divider = this.settings.dividers[dividerId];

this.renderDivider(divider);
});
}
this.renderDivider(divider);
});
//}

// This adds a settings tab so the user can configure various aspects of the plugin
this.addSettingTab(new DividerSettingTab(this.app, this));
Expand Down Expand Up @@ -137,7 +137,7 @@ export default class DividerPlugin extends Plugin {
async renderDivider(divider: Divider) {
const dividerIconEl = this.addRibbonIcon(
"",
`Divider: ${divider.id}`,
`-`,
(evt: MouseEvent) => {}
);
dividerIconEl.addClass("ribbon-divider");
Expand All @@ -150,12 +150,12 @@ export default class DividerPlugin extends Plugin {
* @param divider
*/
async addDivider(divider: Divider) {
if (
/*if (
// @ts-ignore
!(this.app.isMobile && document.body.classList.contains("is-phone"))
) {
this.renderDivider(divider);
}
) {*/
this.renderDivider(divider);
//}

this.settings.dividers[divider.id] = divider;

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "ribbon-divider",
"name": "Ribbon Divider",
"version": "1.1.0-beta.5",
"version": "1.1.0-beta.6",
"minAppVersion": "0.15.0",
"description": "Allows you to add dividers to the ribbon to space out your icons.",
"author": "Andrew McGivery",
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-ribbon-divider",
"version": "1.1.0-beta.5",
"version": "1.1.0-beta.6",
"description": "A plugin for Obsidian.MD that allows you to add dividers to the ribbon to space out your icons.",
"main": "dist/main.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"1.1.0-beta.2": "0.15.0",
"1.1.0-beta.3": "0.15.0",
"1.1.0-beta.4": "0.15.0",
"1.1.0-beta.5": "0.15.0"
"1.1.0-beta.5": "0.15.0",
"1.1.0-beta.6": "0.15.0"
}

0 comments on commit 7410643

Please sign in to comment.