iamphill / Bootstrap-Offcanvas

:zap: Offcanvas menu built with Bootstrap
MIT License
366 stars 111 forks source link

Please add support for manually close the navbar using trigger #37

Closed papaiatis closed 8 years ago

papaiatis commented 8 years ago

As per in the manual there is a offcanvas.toggle trigger I can fire which opens/closes the navbar, eg.:

$("#js-bootstrap-offcanvas").trigger("offcanvas.toggle");

I'd like to have a similar trigger which not triggers but closes the navbar if it was open, something like:

$("#js-bootstrap-offcanvas").trigger("offcanvas.close");

This is also required for my Angular (ajax) application which uses HTML5 Push States to navigate between different pages. When a new state (or page) is loaded the opened offcanvas navbar remains opened. I need it to be closed this case.

iamphill commented 8 years ago

New version with this https://github.com/iamphill/Bootstrap-Offcanvas/releases/tag/2.2.0

papaiatis commented 8 years ago

Thanks, it works! Consider updating your Readme.md as well :wink:

iamphill commented 8 years ago

Good spot! Updated :+1: