Skip to content
This repository was archived by the owner on Aug 5, 2020. It is now read-only.
This repository was archived by the owner on Aug 5, 2020. It is now read-only.

Error after opening drawer #40

@malakada

Description

@malakada

I currently have pikabu configured and working great in a project locally. When the screen is resized smaller, I set up and enable pikabu, and when it becomes larger I undo all of that and display my UI normally for desktop view. This is working fine, except for that it doesn't return my UI back to normal desktop view after I pull a drawer out. I get this error in my console:

Uncaught TypeError: Cannot read property 'scrollHeight' of undefined

So, doing some digging, I found that it's looking for this:

https://github.com/mobify/pikabu/blob/master/src/pikabu.js#L516-L517

And that the sidebar is set here:

https://github.com/mobify/pikabu/blob/master/src/pikabu.js#L417

I found that when I accessed my pikabu object, that pikabu.activeSidebar contained null. Fantastic! "I can solve this!" I thought. So I manually called pikabu.openSidebar('left') which worked, but I still got the Cannot read properly 'scrollHeight' of undefined error. I checked pikabu.activeSidebar to see what it held, and it was holding left as expected. Hmn.

So then I took a look at pikabu.$sidebars and found that it was indeed holding an object with left and right. I tried running pikabu.$sidebars['left'] then, and got []. I then tried pikabu.$sidebars.left and still got [].

screen shot 2014-09-18 at 8 46 41 am

Any idea how to solve this? Is there something else I should be doing? This is how I am initing pikabu:

    self.pikabu = new Pikabu({
      viewportSelector: '.body-chatter',
      widths: {
        left: '90%',
        right: '90%'
      },
      selectors: {
        element: '#candy'
      }
    });

I have also set my m-pikabu-sidebar m-pikabu-left (and right) classes, as well as m-pikabu-nav-toggle and data-role='left' stuff on the toggle buttons.

Any input/help/advice would be greatly appreciated. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions