Access4all / EPUB

3 stars 1 forks source link

When navigating to "Files", for a second there are many entries shown, then only one single entry #36

Closed jmuheim closed 9 years ago

jmuheim commented 9 years ago

When clicking on "Files", for less than a second, a lot of entries (files) are shown. Then the view changes and only "+EPUB" is shown.

Right after clicking on "Files": Many files are shown

A second later: Only one file is shown

I guess this is some lazy JS script or something, that shows/hides stuff.

qtnc commented 9 years ago

Yes, this is because JavaScript hides the tree view on load. I don't think there is a solution, unless I directly add styile="display:none" inside the HTML, which is of course bad. If you have any other suggestion, I'll take it.

jmuheim commented 9 years ago

As far as I can see, the HTML is loaded, and the file tree is a nested ul. Then, using JS, many style="display: none" attributes are added.

Why don't you work with a class like .collapsed, which is by default added to all li elements, and has the following definition?

li.collapsed > ul
  display: none

Then, when clicking on a folder, simply toggle the .collapsed class. This way, the styles are already present when the page is loaded, and no flickering will happen.