baker icon indicating copy to clipboard operation
baker copied to clipboard

Menu doesn't show with Baker 3.2 and Laker Starter Kit

Open kilop opened this issue 14 years ago • 16 comments

Anyone have this problem? Any solution?

I only can have my book working with Baker 3.1

Thanks for any help.

kilop avatar Apr 20 '12 16:04 kilop

I'm having the same issue. I'm using the latest version of Laker along with Baker. The developer of Laker describes the problem here:

http://www.lakercompendium.com/2012/04/10/laker-1-3-released-fix-for-toc/#comments

I'm still having the issue even with the latest versions of Baker and Laker.

steveRW avatar Apr 20 '12 20:04 steveRW

I had that problem before the TOC update and fixed it with a bit of trial-and-error. There's a few things it could be but chances are it's a problem with book.json. Make sure the book.json is exactly as it should be. In my case it was a comma after my last html page when there shouldn't be one, for example:

"contents": [
    "0001.html",
    "0002.html",        
    "001.html",
    "002.html",
    "003.html",
    "004.html",
    "005.html"
]

stemmo avatar Apr 21 '12 08:04 stemmo

I have been testing and looking around the issue multiple times over and I found a solution/workaround

The way that Baker implemented the navigation with the viewport arrangement in version 3.2 is quite clever. In essence, it doesn't need the book.json to declare the height or width of the navigation bar. It is now defined using the viewport value in the index.html. Florian (laker's lead developer) thought it was an issue with the include script that he used to include HTML files. However, that is not the case.

It all lies in the viewport definition in the index file. I was originally defining the width of the entire include element (and thus the document) using CSS on the include element. However, that wasn't registering the size of the viewport. So instead of using CSS, I explicitly defined the size of the viewport height and width. Needless to say, that solved the problem :)

Steps to fix:

  1. Open index.html in /book in your favorite text editor

  2. Replace the following line: <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;" />

With the following: <meta name="viewport" content="width=2040; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;" />

  1. Save and run in the simulator

Please note the following:

  • For additional navigation elements to fit, you need to add additional pixels to the width. In Laker's example, it's 410 per navigational stretch
  • Baker developers should support the device-width to prevent this issue from cropping up
  • For Laker 1.3 specifically, you can modify the table of contents directly in the index.html.

nerveband avatar Apr 22 '12 19:04 nerveband

Thank you so much for that. It was extremely helpful. I found that I also had to edit in nav.css the selector body.body-toc-ios and adjust the width according to my toc list. In my case, I have eight navigation items so I had to multiply 8×410 to get the correct width.

There's one peculiarity I'm still finding. On the iPad, I can push the table of contents list up-and-down. I haven't experimented yet with how to fix this. has anybody come across this.

steveRW avatar Apr 23 '12 15:04 steveRW

I also ran into that same issue and I fixed it the same way.

<meta name="viewport" content="width=2040; height:205; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;" />

I'd also remove the line defining the navigation height in book.json to prevent any conflict of size selection.

Your browser's inspector can help you determine what the right sizes to appropriate: See this image: http://d.pr/i/GoQz

nerveband avatar Apr 23 '12 21:04 nerveband

Hello. I'm having the some issue of steveRW. I can push the table of contents list up-and-down. If i remove the height from book.json, the index menu doesn't work. I added too the height at meta viewport, but still have the same issue.

Any news about this situation? Thanks 1 lot.

kilop avatar Apr 27 '12 12:04 kilop

Whoops, I noticed an error in my syntax in my previous post. There should have been an equal sign, not a colon (CSS and HTML confusion right there). The reason why you can push the table of contents "up and down" is because the viewing window is smaller than the height of the HTML document. Basic steps to follow:

  1. Remove line determining navigation height in book.json (-baker-index-height: xx)
  2. Open your index.html and edit the viewport to reflect the following: <meta name="viewport" content="width=2040; height=205; initial-scale=1.0; maximum-scale=1.0; user-scalable=no;" />

Note that you may have to change the height depending on your specification navigation. Try values like 202, 204, etc. until that solves your problem. Also, when running your tests, make sure you run clean from the projects menu followed by build to ensure the cache has been flushed and the changes are rendered.

You also might be able to solve the problem by defining a larger height in your book.json. Whatever value you put in book.json will override the viewport value.

nerveband avatar Apr 29 '12 14:04 nerveband

In my case, this problem was caused by css clashes/hiccups. Two things I suggest:

  1. Make sure your width is correctly set (number of indexed pages x 410px) in nav.css.
  2. Include a direct link to nav.css in the header of your index.html, i.e. "link href="styles/nav.css" rel="stylesheet" type="text/css". (For some reason, this wasn't being imported in my app.)

stemmo avatar May 02 '12 11:05 stemmo

Florian's latest release seems to have fixed this bug so everybody's happy!

In his release he seems to have changed the json height to 205 and kept the viewport width as device-width...

charge-valtech avatar May 02 '12 13:05 charge-valtech

How can we download the last release? Thx!

kilop avatar May 02 '12 13:05 kilop

http://www.lakercompendium.com/download/

charge-valtech avatar May 02 '12 13:05 charge-valtech

Just finish the test with Baker 3.2 and Laker Starter Pack 1.4 and the problem is there :(

kilop avatar May 02 '12 14:05 kilop

Hello. Anyone can send me an example of a book with index working well? Thanks

kilop avatar May 03 '12 14:05 kilop

@kilop: My advice would be to try building an index by yourself. It's really easy the way we implemented it now, no additional code is required: just make sure that it is a long strip (and add the fixed sizing as above only if it doesn't work). :)

As for the example, there's the Baker default book with a working index. ;)

folletto avatar May 07 '12 21:05 folletto

  1. Remove line determining navigation height in book.json (-baker-index-height: xx)
  2. Open your index.html and edit the viewport to reflect the following:

////

For me only change index.html (2) fix the TOC. Before I saw only Cover, Dossier 1, Dossier 2. Now, everything is visible.

When I remove baker-index-height:xx the TOC flows across the screen and disappear.

Colacino avatar May 19 '12 20:05 Colacino

A note for completeness sake.

I just reproduced the issue with Baker 3.2 and Laker 1.4. I had no issue with pushing the index bar content up and down, but there is definitely a problem with horizontal scrolling, as the index bar cannot be completely scrolled.

However, this has been fixed in the master branch, so the fix will be included in the upcoming 3.2.1 release.

Simbul avatar Aug 20 '12 21:08 Simbul