obsidian-dev-tools
obsidian-dev-tools copied to clipboard
Feature Request: Add a command to toggle the mobile UI (code snippet in comment)
I have my own mobile theme that I may want to work on sometimes, the only way I've found to change Obsidian to the mobile ui on desktop is entering this snippet in the console:
this.app.emulateMobile(!this.app.isMobile);
I looked at the Obsidian Sample Plugin, and while I'm not very familiar with the Obsidian API, came up with this command to toggle it on and off:
this.addCommand({
id: "toggle-mobile-view",
name: "Toggle Mobile View",
callback: () => {
this.app.emulateMobile(!this.app.isMobile);
}
});