Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing when drawer is opened #2

Open
dnmd opened this issue Sep 17, 2015 · 0 comments
Open

Resizing when drawer is opened #2

dnmd opened this issue Sep 17, 2015 · 0 comments

Comments

@dnmd
Copy link

dnmd commented Sep 17, 2015

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');

    }   
});     
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant