simonw / datasette-column-inspect

Experimental plugin that adds a column inspector
Apache License 2.0
3 stars 0 forks source link

Detect portrait mobile phone users and tell them to switch to landscape #2

Open simonw opened 4 years ago

simonw commented 4 years ago

The plugin only makes sense in table view mode right now, easiest way to access it on mobile is to rotate to landscape! It should tell people that.

simonw commented 4 years ago

https://github.com/simonw/datasette/blob/7e357abbc38dcc9d19a2f1df3252668a48e941e4/datasette/static/app.css#L46

@media only screen and (max-width: 576px) {

Datasette treats 576px as the cut-off point for portrait mode (when tables lose their headers).

simonw commented 4 years ago

So if (window.innerWidth < 576) should do the trick.

simonw commented 4 years ago

The box should update when they DO switch to landscape - otherwise the user has to rotate to landscape and then refresh the page, and they won't know they need to do that.