caffeinated / menus

:pushpin: Menu generator package for the Laravel framework
https://caffeinatedpackages.com
132 stars 59 forks source link

tweaked activate() in Item.php to add 'opened' class for parent #55

Closed mlanser closed 9 years ago

mlanser commented 9 years ago

Some of the Bootstrap-based themes require that CSS class 'opened' is added to the parent '

  • ' tag of a sub-menu item. Without that 'opened' class, the parent menu item stays closed even when a sub-menu item is marked 'active'.

    Perhaps there is a more elegant (and possibly more flexible) way to solve this, but my suggested change definitely works on themes that rely on the 'opened' class to be added.

    Thanks .. -martin.

  • kaidesu commented 9 years ago

    I'll add this for now, but will definitely need something that's a little more flexible to cover all use-cases down the road.

    Thanks for the pull request!

    mlanser commented 9 years ago

    I don't know what happened, but I keep getting the following error when I do a 'composer update' or 'php artisan clear-compiled':

    PHP Fatal error: Class 'Caffeinated\Menus\MenusServiceProvider' not found in /var/www/htdocs/omniview/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 146

    Do you get this error? Any thoughts? I feel I've tried absolutely everything at this point, but I cannot figure it out.

    TIA

    kaidesu commented 9 years ago

    Looks like you had changed the Composer autoload path. My fault for not checking the pull-request before merging though.

    Latest version has been fixed.

    mlanser commented 9 years ago

    Argh .. how did I not see that? Really sorry about that. Works now.

    Thanks!