Coder Social home page Coder Social logo

Comments (3)

EisenbergEffect avatar EisenbergEffect commented on May 6, 2024

Yes. That's an unfortunately aspect of how the DOM works. To get around this issue, you can register the plugin with the global behavior.

Here's the code to do that:

GlobalBehavior.jQueryPlugins['nanoscroller'] = 'nanoScroller';

from framework.

Kennethtruyers avatar Kennethtruyers commented on May 6, 2024

That is not really obvious. Also this means that the automatic behavior won't work with any jQuery plugin that has a capital in its method call (which is about every plugin due to camelCasing).

I can see two possible workarounds:

  1. allow for a special property so you can override the method-call:

    <div jquery.nanoscroller="someProperty: true; pluginName: nanoScroller">Content</div>

  2. When a method is not found with that name in lowercase, iterate over all jquery methods and check if there's a lowercase match. In that case, call the lowercase match. Obviously this is not optimal and you could output a warning to the console to say that it should add the line to GlobalBehavior.jQueryPlugins.

If you want, I could provide a pull-request for this, just let me know if you would want this and if so, which approach you prefer (or a combination of both).

from framework.

EisenbergEffect avatar EisenbergEffect commented on May 6, 2024

I agree. This is a bit of an experimental feature. It should be possible to implement #2 in the jQuery handler. If you want to send a PR for that, I'd be happy to accept it. Just make sure to sign the CLA and follow the contrib guide.

from framework.

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.