Giter Club home page Giter Club logo

Comments (6)

vadikom avatar vadikom commented on July 20, 2024

Hi and thanks very much for your input! 👍

Indeed, in the current version the addon is initialized just once ondomready and any navbars that are added in the DOM dynamically after that won't be initialized. So it really makes sense to rework the addon and expose some init method that could be called at any time. I will try to do this in the next few days and will post back. Stay tuned..

from smartmenus.

clayzermk1 avatar clayzermk1 commented on July 20, 2024

That'd be great! Thank you so much.

from smartmenus.

vadikom avatar vadikom commented on July 20, 2024

OK, I just committed the updates. You can grab the code from here (note that the core also needed some changes so it's a good idea to use the updated one below to avoid any issues):

https://raw.githubusercontent.com/vadikom/smartmenus/master/src/addons/bootstrap/jquery.smartmenus.bootstrap.js
https://raw.githubusercontent.com/vadikom/smartmenus/master/src/jquery.smartmenus.js

All updates will be included in the next release so you don't need to worry about upgrading in the future.

You can now call $.SmartMenus.Bootstrap.init() when your navbar is available in the DOM. It's not a problem to call it multiple times, it will only handle navbars that are still not initialized.

Note that the following methods might also be handy (you can use them just fine with the Bootstrap addon, just set some id to your ul.navbar-nav so you can call them for it):

http://www.smartmenus.org/docs/#refreshInstance
http://www.smartmenus.org/docs/#destroyInstance

from smartmenus.

clayzermk1 avatar clayzermk1 commented on July 20, 2024

Awesome! Thank you so much!

FYI, the dists look like they weren't built for the last commit.

from smartmenus.

clayzermk1 avatar clayzermk1 commented on July 20, 2024

Tested, works like a champ for me! Thank you again! 🍻

from smartmenus.

vadikom avatar vadikom commented on July 20, 2024

Np at all! This will surely be useful to others so I really appreciate your input!

I only build the dists for new versions and I have planned some other fixes too for the new release so it will wait for now (that's why I pointed you to the "src" folder).

OK, I'm closing this.. Cheers!

from smartmenus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.