Skip to content

Commit

Permalink
fix: Temporarily remove Export Custom Types button from mobile until …
Browse files Browse the repository at this point in the history
…it can be fixed
  • Loading branch information
valentine195 committed Mar 29, 2022
1 parent 5d6fb49 commit f56ebb8
Showing 1 changed file with 34 additions and 28 deletions.
62 changes: 34 additions & 28 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
TextComponent,
Notice,
setIcon,
TFile
TFile,
Platform
} from "obsidian";
import {
Admonition,
Expand Down Expand Up @@ -57,33 +58,38 @@ export default class AdmonitionSetting extends PluginSettingTab {
const admonitionEl = this.containerEl.createDiv(
"admonitions-nested-settings"
);
new Setting(admonitionEl)
.setName("Export Custom Types as CSS")
.setDesc("Export a CSS snippet for custom callout types.")
.addButton((b) =>
b
.setIcon("download")
.onClick(() => {
const sheet = [
`/* This snippet was auto-generated by the Admonitions plugin */\n\n`
];
const file = new Blob(
[this.plugin.calloutManager.generateCssString()],
{
type: "text/css"
}
);
createEl("a", {
attr: {
download: "custom_callouts.css",
href: URL.createObjectURL(file)
}
}).click();
})
.setDisabled(
!Object.keys(this.plugin.data.userAdmonitions).length
)
);
if (!Platform.isMobile) {
new Setting(admonitionEl)
.setName("Export Custom Types as CSS")
.setDesc("Export a CSS snippet for custom callout types.")
.addButton((b) =>
b
.setIcon("download")
.onClick(() => {
const sheet = [
`/* This snippet was auto-generated by the Admonitions plugin */\n\n`
];
const file = new Blob(
[
this.plugin.calloutManager.generateCssString()
],
{
type: "text/css"
}
);
createEl("a", {
attr: {
download: "custom_callouts.css",
href: URL.createObjectURL(file)
}
}).click();
})
.setDisabled(
!Object.keys(this.plugin.data.userAdmonitions)
.length
)
);
}

new Setting(admonitionEl)
.setName("Use CSS Snippet for Custom Callouts")
Expand Down

0 comments on commit f56ebb8

Please sign in to comment.