Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add a command to toggle the mobile UI (code snippet in comment) #7

Open
YousufSSyed opened this issue Mar 30, 2023 · 0 comments

Comments

@YousufSSyed
Copy link

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);
      }
    });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant