Giter VIP home page Giter VIP logo

Comments (3)

cferdinandi avatar cferdinandi commented on June 30, 2024

At present you actually can't. The way the script is written, calling init cancels out any previously existing one.

There are different ways to structure the plugin to avoid this, but it would require me to rewrite some stuff, and I don't have time to commit to that at the moment.

Sorry about that!

from gumshoe.

shofer4eto avatar shofer4eto commented on June 30, 2024

I understand you are busy, still - thanks for the great plugin! :)
I could try to do it myself ... From what I understand I could mod the "deactivateCurrentNav" method to possibly walk only items in the current menu tree? Would that do the trick?

Quick question - is the Minified version of the script in the DIST folder somehow different than the regular one? Couldn't seem to find the "deactivateCurrentNav" method in there?

Thanks again for your work and time spent, it's well appreciated! :)

from gumshoe.

cferdinandi avatar cferdinandi commented on June 30, 2024

The script will destroy any current implementation if you try to reinit it with a different selector. You might be able to most easily hack this by just removing the destroy method. I think that alone would get you what you're looking to do.

If you decide not to do that or it doesn't work, on init, the script grabs all of the nav items and catalogs and crawls them as you scroll. Then it activates just the first one that matches. You'd need to make it not bail once it finds a match, and probably modify deactivateCurrentNav as well.

The minifier I use is very aggressive, so it changes all of the non-public function names. Anything that can be called with gumshoe retains its name (gumshoe.init(), gumshoe.destroy(), etc.), while anything that's just set as a var gets it's name changed to a single character to reduce filesize.

So deactivateCurrentNav might get renamed g, for example. As such, you definitely want to work with the src version of the file, or at least the unminified dist.

from gumshoe.

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.