Skip to content

Commit

Permalink
fix: Display dice results in dice view on mobile (close #322)
Browse files Browse the repository at this point in the history
  • Loading branch information
valentine195 committed Sep 25, 2024
1 parent 1501454 commit 95b648d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/view/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
ExtraButtonComponent,
ItemView,
Notice,
Platform,
TextAreaComponent,
WorkspaceLeaf
} from "obsidian";
Expand Down Expand Up @@ -341,13 +342,18 @@ export default class DiceView extends ItemView {
await navigator.clipboard.writeText(`${result.result}`);
});
copy.extraSettingsEl.addClass("dice-content-copy");
if (Platform.isMobile) {
resultEl.createSpan({
cls: "dice-content-result",
text: `${result.resultText}`
});
}
resultEl.createEl("strong", {
attr: {
"aria-label": result.resultText
},
text: `${result.result}`
});
/* .appendChild(roller.containerEl.cloneNode(true)) */

const context = resultEl.createDiv("result-context");

Expand Down

0 comments on commit 95b648d

Please sign in to comment.