sphinx_rtd_theme icon indicating copy to clipboard operation
sphinx_rtd_theme copied to clipboard

Make sidebar slide in and slide out

Open dojutsu-user opened this issue 7 years ago • 12 comments

Fixes #697

Final result: dimpledmediocreherald-small

dojutsu-user avatar Nov 04 '18 16:11 dojutsu-user

I am still unsure about these lines

https://github.com/rtfd/sphinx_rtd_theme/blob/4a3d790e61d7524baac698badee814cd286b1219/sass/_theme_layout.sass#L372-L375

dojutsu-user avatar Nov 04 '18 16:11 dojutsu-user

Oops wrong PR

Blendify avatar Nov 05 '18 23:11 Blendify

I think this makes sense but one additional thing that should be added is swipe gesture support

Seems pretty simple, here is a jquery example: http://demos.jquerymobile.com/1.3.2/examples/panels/panel-swipe-open.html#&ui-state=dialog

Blendify avatar Nov 05 '18 23:11 Blendify

@Blendify I don't know why, but I didn't get it working with jquery. But it is working fine with vanilla javascript. Here is the final result

ezgif-5-db0d8c0d67dd

dojutsu-user avatar Nov 06 '18 07:11 dojutsu-user

@jessetan I think I have added all the improvements suggested by you. Also, I have changed the javascript code to jquery, implementing the swiperight and swipeleft events, but for some reason it is still not working.

dojutsu-user avatar Nov 06 '18 22:11 dojutsu-user

@jessetan Added the improvements. I googled a little bit and found that maximum allowed time for the swiping so that the sidebar slides in can be added. I have added it. Need you review.

dojutsu-user avatar Dec 07 '18 14:12 dojutsu-user

If I run this in desktop Chrome devtools with device emulation, my vertical scrolling is broken when the menu is visible. Does it work for you (on a real device)?

jessetan avatar Dec 19 '18 14:12 jessetan

@jessetan

my vertical scrolling is broken

Exactly what you mean by this? I tested it on a real device and the only unexpected thing I noticed that if I'm on a middle of a page and swiped right (to open navbar), then it move me back to the starting of the page.

dojutsu-user avatar Dec 19 '18 16:12 dojutsu-user

Exactly what you mean by this?

I mean that I can swipe up and down to scroll the body content when the menu is collapsed, but when the menu is open I can not swipe up and down to scroll the body content nor the contents of the menu if it is longer than can fit on the screen.

jessetan avatar Dec 21 '18 10:12 jessetan

@jessetan When the menu is open, swiping up/down on the body is not there. But I can swipe up/down on the menu if it is longer than the screen size (tested on a real device).

ezgif-4-68eed51cc744

dojutsu-user avatar Dec 21 '18 10:12 dojutsu-user

@jessetan Any update on this?

dojutsu-user avatar Jan 05 '19 11:01 dojutsu-user

Expanding the menu on the "Paragraph level markup" page in the the documentation (https://sphinx-rtd-theme.readthedocs.io/en/latest/demo/demo.html) makes the content part invisible. This works if I remove the position: fixed on .wy-nav-content-wrap.shift but there may be other side effects.

Is it possible to close the menu when the content part is clicked/tapped? That feels more logicol on mobile

With this PR I can't seem to do inertial scrolling (is that the name?) on mobile Chrome or Safari where you give it a fast flick and it keeps scrolling for a while

jessetan avatar Feb 05 '19 13:02 jessetan