mathjax / MathJax-website

The MathJax website
https://www.mathjax.org
22 stars 21 forks source link

MathJax Menu not working in the modals #10

Closed pkra closed 9 years ago

pkra commented 9 years ago

Increasing z-index is not enough so probably some conflict with bootstrap. Needs fixing, especially in the reuse modal...

pkra commented 9 years ago

@dpvc could you take a look?

dpvc commented 9 years ago

You need to increase the z-index on the MenuFrame, not the menu itself. Use

MathJax.Hub.Register.StartupHook("MathMenu Ready",function () {
  MathJax.Menu.BGSTYLE["z-index"] = 2000;
});

and see if that works.

pkra commented 9 years ago

I had tried that (see https://github.com/mathjax/MathJax-website/blob/gh-pages/_includes/head.html#L43) and this made the menu visible -- but the functionality of the menu was lost, i.e., the click events didn't work (I'm guessing since the bootstrap modal closes when you click outside of it but I couldn't figure it out). I suppose that answers my own question -- I have to figure out how to override bootstrap's modal; urgh...

dpvc commented 9 years ago

Sorry, my misunderstanding. You need to change the z-index on both the frame and the menu. Try adding

MathMenu: {
  styles: {
    ".MathJax_Menu": {"z-index":2001}
  }
}

to your configuration in addition to the startup hook above.

pkra commented 9 years ago

woohoo! Thanks for your patience -- it works (and I've learned something about z-index).