nicolas-t/Chocolat

Did not appear as expected

kevariable opened this issue · 5 comments

thank you for all this work. Chocolat is fantastic.

but something wrong on my layout

image

after i clicked seems like undefined class

my javascript

latest version of npm

Chocolat(document.querySelectorAll('.chocolat-image'), {
    container: document.querySelector('body'),
    fullscreen: true,
    imageSize: 'contain'
  })

Hello,

If you try like this it should remove the undefined class :

Chocolat(document.querySelectorAll('.chocolat-image'), {
    container: document.querySelector('body'),
    fullscreen: true,
    imageSize: 'contain',
    className: ''
  })

Do you have any issue aside from the undefined class that shouldn't be there ?

Thanks in advance

Chocolat(document.querySelectorAll('.chocolat-image'), {
    container: document.querySelector('body'),
    fullscreen: true,
    imageSize: 'contain',
    afterInitialize() {
      const sidebar = document.querySelector('.c-sidebar')

      if (sidebar.classList.contains('c-sidebar-lg-show')) {
        sidebar.classList.remove('c-sidebar-lg-show')
      }
    },
    afterClose() {
      const sidebar = document.querySelector('.c-sidebar')

      if (!sidebar.classList.contains('c-sidebar-lg-show')) {
        sidebar.classList.add('c-sidebar-lg-show')
      }
    },
  })

i think it solve my problem with sidebar

but headers cover up, how can i set an index ?

image

You can use regular css.

body .chocolat-wrapper {
    z-index: 1;
}

thanks a lot sir!

body .chocolat-wrapper {
  z-index: 9999999999999999999;
}

it should be nice