moodle-an-hochschulen / moodle-local_boostnavigation

Moodle plugin which tries to overcome some fixed appearance behaviours of Boost's nav drawer in a clean way
GNU General Public License v3.0
39 stars 28 forks source link

No gap above bottom nodes #32

Closed jrm-unamur closed 5 years ago

jrm-unamur commented 5 years ago

Capture d’écran 2019-04-29 à 11 48 04 Hi Alex, When I add bottom nodes to my site, they show at the end of root nodes but without a separation (gap) over them. In a previous issue, you told me

The plugin supports three different areas for custom nodes: Custom nodes within the course navigation, custom nodes within the root navigation and custom nodes at the bottom of the navigation. If you add nodes to the bottom nodes area like it was done with the "Information for students" node, these nodes will be shown with a gap above them. If this does not work for you, please create a separate issue to discuss the problem.

This doesn't work for me and I cannot find in the code where it should be handled. In the attached image, you can see two extra "root" nodes in the blue box, and two "bottom nodes" in the red one. If all nodes had been defined as extra root nodes, the result would have been the same. Any hint? Cheers Jean-Roch

jrm-unamur commented 5 years ago

Hi again, If you can confirm the behaviour, here's a css fix

.list-group-item {
    &[data-key^="localboostnavigationcustombottom"] {
        margin-top: .5rem;
    }
    &[data-key^="localboostnavigationcustombottom"] ~ [data-key^="localboostnavigationcustombottom"] {
        margin-top: 0;
    }
}

Cheers

abias commented 5 years ago

Hi Jean-Roch,

for bottom nodes, there is the rule https://github.com/moodleuulm/moodle-local_boostnavigation/blob/master/styles.css#L67-L71 which adds a gap above them. But I had to see now that this rule is not processed anymore if you add a custom ID attribute to a bottom node as it has the node counter 1 hardcoded.

I have now fixed this based on your excellent proposal in https://github.com/moodleuulm/moodle-local_boostnavigation/commit/0fc8a17350c2a61841ad6f4191735ad0b27bbd88.

Thanks, Alex