mdbootstrap / material-design-for-bootstrap

Important! A new UI Kit version for Bootstrap 5 is available. Access the latest free version via the link below.
https://mdbootstrap.com/docs/standard/
MIT License
9.34k stars 1.15k forks source link

sideNav closeOnClick - sn is not defined #105

Closed coreystinson2 closed 6 years ago

coreystinson2 commented 7 years ago

I believe there to be a typo in mdb.js file when using sideNav with closeOnClick: true.

17923 if (this.options.closeOnClick === true) {
17924     this.menu_id.on("click", "a:not(.collapsible-header)", function () {
17925         sn.removeMenu();
17926     });
17927 }

sn is not referenced anywhere and should be replaced with _this as referenced elsewhere within the component.

17923 if (this.options.closeOnClick === true) {
17924     this.menu_id.on("click", "a:not(.collapsible-header)", function () {
17925         _this.removeMenu();
17926     });
17927 }

Steps to reproduce Copy the html provided under basic usage: https://mdbootstrap.com/javascript/sidenav/

Initialize sideNav with following option

$('.button-collapse').sideNav({closeOnClick: true});
mattonit commented 7 years ago

What's your version of MDB?

mattonit commented 6 years ago

closed due to no response