Skip to content

Commit

Permalink
Add mobile compatibility (#156)
Browse files Browse the repository at this point in the history
* Add mobile compat

* Remove monkeypatch

* fix modal styling

* Bump version 1.5.6
  • Loading branch information
liamcain committed Mar 22, 2021
1 parent 9967945 commit 02284b3
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 30 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "calendar",
"name": "Calendar",
"description": "Calendar view of your daily notes",
"version": "1.5.5",
"version": "1.5.6",
"author": "Liam Cain",
"authorUrl": "https://github.com/liamcain/",
"isDesktopOnly": false,
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "calendar",
"version": "1.5.5",
"version": "1.5.6",
"description": "Calendar view of your daily notes",
"author": "liamcain",
"main": "main.js",
Expand All @@ -13,8 +13,8 @@
},
"dependencies": {
"obsidian": "obsidianmd/obsidian-api#master",
"obsidian-calendar-ui": "0.3.6",
"obsidian-daily-notes-interface": "0.7.7",
"obsidian-calendar-ui": "0.3.8",
"obsidian-daily-notes-interface": "0.7.8",
"svelte": "3.35.0",
"tslib": "2.1.0"
},
Expand Down
2 changes: 0 additions & 2 deletions src/testUtils/mockApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ const mockApp: App = {
remove: () => Promise.resolve(),
rename: () => Promise.resolve(),
copy: () => Promise.resolve(),
setCtime: () => Promise.resolve(),
setMtime: () => Promise.resolve(),
},
getName: () => "",
getAbstractFileByPath: () => null,
Expand Down
2 changes: 1 addition & 1 deletion src/ui/fileMenu.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { App, Menu, Point, TFile } from "obsidian";

export function showFileMenu(app: App, file: TFile, position: Point): void {
const fileMenu = new Menu();
const fileMenu = new Menu(app);
fileMenu.addItem((item) =>
item
.setTitle("Delete")
Expand Down
27 changes: 15 additions & 12 deletions src/ui/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@ export class ConfirmationModal extends Modal {

this.contentEl.createEl("h2", { text: title });
this.contentEl.createEl("p", { text });
this.contentEl
.createEl("button", { text: "Never mind" })
.addEventListener("click", () => this.close());

this.contentEl
.createEl("button", {
cls: "mod-cta",
text: cta,
})
.addEventListener("click", async (e) => {
await onAccept(e);
this.close();
});
this.contentEl.createDiv("modal-button-container", (buttonsEl) => {
buttonsEl
.createEl("button", { text: "Never mind" })
.addEventListener("click", () => this.close());

buttonsEl
.createEl("button", {
cls: "mod-cta",
text: cta,
})
.addEventListener("click", async (e) => {
await onAccept(e);
this.close();
});
});
}
}

Expand Down
22 changes: 11 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3319,26 +3319,26 @@ object.pick@^1.3.0:
dependencies:
isobject "^3.0.1"

obsidian-calendar-ui@0.3.6:
version "0.3.6"
resolved "https://registry.yarnpkg.com/obsidian-calendar-ui/-/obsidian-calendar-ui-0.3.6.tgz#c52932be198beb56a887dd1a0ca127c00e5751c8"
integrity sha512-1TdigvCdAbqkfsteGE7N//9DqxEai1xh6ZifL4aVvionv573USFGlvYhxrC9dVOkGahG3zoXDPwcmD48iUFoYw==
obsidian-calendar-ui@0.3.8:
version "0.3.8"
resolved "https://registry.yarnpkg.com/obsidian-calendar-ui/-/obsidian-calendar-ui-0.3.8.tgz#fa5f8e90f91156f6ea4d8bbbe53dee78e51bde1f"
integrity sha512-ZiF7GS3vaY2vk4h1FR8yJMuop0hJyT/ClkojW/n0egS1kZPA5wyqeb596gFnMdpvi6MEc4k83nRXy0CN1pIOcA==
dependencies:
obsidian-daily-notes-interface "0.7.7"
obsidian-daily-notes-interface "0.7.8"
svelte "3.35.0"
tslib "2.1.0"

obsidian-daily-notes-interface@0.7.7:
version "0.7.7"
resolved "https://registry.yarnpkg.com/obsidian-daily-notes-interface/-/obsidian-daily-notes-interface-0.7.7.tgz#55057284d1258fc38143fd3adc16203839e3e8a7"
integrity sha512-RAK4Z47qCY6JEWUieseMKc8KOpBxPBSxyRweptxJlTWNrh7iF8ROy+yj/R+c54t7ol8YtkW/CZGf7lr4dtakNQ==
obsidian-daily-notes-interface@0.7.8:
version "0.7.8"
resolved "https://registry.yarnpkg.com/obsidian-daily-notes-interface/-/obsidian-daily-notes-interface-0.7.8.tgz#6bb301ec097cd498fdae07138c892e69930e7994"
integrity sha512-9zHeT3q6jLbAd8/x+Bq9Zp6KfVUIKayjRiIYJ98DGYTI29BDf/5jmZgtyyNkxS1kWraiLFSlaG120oXlfWEqWg==
dependencies:
obsidian obsidianmd/obsidian-api#master
tslib "2.1.0"

obsidian@obsidianmd/obsidian-api#master:
version "0.11.0"
resolved "https://codeload.github.com/obsidianmd/obsidian-api/tar.gz/81ab85ade4552c9116c1e10d009127e62019c923"
version "0.11.7"
resolved "https://codeload.github.com/obsidianmd/obsidian-api/tar.gz/55946e5a6259a28c416d2d6e600a7964a86a01dd"
dependencies:
"@types/codemirror" "0.0.98"

Expand Down

0 comments on commit 02284b3

Please sign in to comment.