Skip to content

Resizing when drawer is opened #2

@dnmd

Description

@dnmd

Hi,

Nice plugin, thanks for sharing! I experience a small issue; when the drawer is opened and I resize my browser, the mediaqueries for the menu kicks in, but the width on the menu is not removed.

I hide the drawer by adding a resize event, to trigger the hide method, but this does not fully function/revert somehow, the width on the #navbar remains. Do you have any suggestions to "properly" close the drawer? Of course I can hack around, remove the width, but I like it doing it the proper way :)

$(window).on('resize.bs.drawer', function() {

    //$(window).width() > 768 is not accurate. Test a class to see if the mediaquery is present.
    if ( $(".drawer .navbar-toggle").css("display") === "none"){

        //Close the drawer, hide the backdrop. 
                //The width of the menu is not reverted to its original...
        $target.drawer('hide');

        //Unbind this resize event.
        $(this).off('resize.bs.drawer');

    }   
});     

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions