Picture of Matt Leathes
Re: Popup when clicking drawer
by Matt Leathes - Wednesday, 26 August 2020, 8:49 AM
 
However, it should have a button in the 'menu mode'.

Right, but the problem is that, unless you are only using this in one course where you know exactly what will and won't be in the drawer, you cannot guarantee that the drawer will ever display in 'menu mode'. Which is exactly the problem you are getting in your not working example

You therefore need to account for the display mode as well.

I get that you don't want to display the studylist itself in display mode, you want a button that opens the studylist 'overlay'. It's this button that should be rendered in your 'display mode'.

However, this will have the unfortunate side-effect of meaning that, when there's more than one extension in the drawer, your learner will have to click three times to get to the studylist overlay.

Perhaps one workaround would be to have your selectiveFeedback:clickedDrawer handler check how many items there are in the drawer at that point. If > 1 then immediately show the studylist popup. But if there's just one, do drawer.triggerCustomView to render the studylist button into the drawer.

Either that or, seeing as you just want a button that opens an overlay, don't put it in the drawer at all. Just inject the button into the navbar.