oakes / play-clj

A Clojure game library
The Unlicense
939 stars 73 forks source link

about DOCS page #45

Closed ghost closed 9 years ago

ghost commented 10 years ago

Ey recently i've been on play-clj DOCS page a lot. And i find the behaviour of the page mighty annoying. Say, i wanna look at --> play-clj.math section --> i scroll to it --> open vector-3 for example --> and immediately the whole list scrolls all the way up. Means that i have to open each page to a new tab OR i have to keep scrolling the list just so i can return to the section i was just looking at. I could possibly come up with some css / js to make it a lil more user-friendly..

oakes commented 10 years ago

Yeah, I'm not the greatest at web design. I think the best solution would be to use an iframe for the sidebar, even though they are kinda frowned upon.

ghost commented 10 years ago

ey I made this piece of js for you. Its a little overkill atm, but its due to the html structure of the page. Since theres no structure like a list for example, for the links, i had to write a script that knows where all the links and the ns sections are (couldnt just go and access parents / children of specific section). So far the script just scrolls the sidebar to that section you just opened a page from. Theres an interval func which looks for the "sidebar" class and checks if theres all them goodies, if its not found after few secs, it cancels the interval and nothing happens. I cant figure why it wouldnt work, i wrote it in browser while on the docs page, so adding it to just about anywhere should be ok. In theory if you add new ns sections it should know how to include them. about 2 class names are hard coded in it.

https://gist.github.com/jaakkoj/db2c6e6e2b97df03b40b

edit: About iframes , i dont know, not sure if ive ever used one tbh....

oakes commented 9 years ago

Fixed via https://github.com/oakes/play-clj/pull/65