jBox icon indicating copy to clipboard operation
jBox copied to clipboard

zindex auto with bootstrap modals

Open redtopia opened this issue 2 years ago • 1 comments

I am migrating some dialogs to jBox, but I also have lots of bootstrap modals in my app that will remain for a while. I've got my bootstrap modals always opening on the top, and are jBox aware. However, I'm not sure how to make jBox aware of bootstrap modals. I am currently setting the zIndex option to 'auto', which is great for interacting with other jBox modals.

Would there be a way for me to set the zindex before a jBox modal is open? The trick is to do this every time the modal is open, because if it was closed, and then another modal opened, I would want to update the zindex accordingly.

Thanks!

redtopia avatar Aug 01 '22 23:08 redtopia

Since the zIndex is set when jBox is created the only option is to override it in the onOpen method: https://jsfiddle.net/StephanWagner/1hsqb9eo/

  new jBox('Modal', {
    onOpen: function() {
      this.wrapper.css({zIndex: 40});
    }
  });

StephanWagner avatar Aug 03 '22 10:08 StephanWagner