Giter Site home page Giter Site logo

Comments (4)

LCweb-ita avatar LCweb-ita commented on May 31, 2024

Hello. The DOM necessarily needs to be changed since inputs must be wrapped with the switch code.
However in v2 I use

el.parentNode.insertBefore(wrapper, el)
(line 198)

Then attached listeners should still work. Sincerely don't know other ways to achieve it differently

from lc-switch.

clst avatar clst commented on May 31, 2024

Yeah I am using v2 (pretty neat, btw). The change event didn't trigger anymore after lc_switch loaded.
I changed your custom event then it works with the listener above even after replacing the DOM with new inputs later.
b153ae2

from lc-switch.

LCweb-ita avatar LCweb-ita commented on May 31, 2024

Thanks for the clarification, however $(document).on("change lcs-statuschange", 'input' ... works if you place it in the demo.html file. Before and after the plugin initialization.

The "lcs-statuschange" event is correctly handled.

from lc-switch.

clst avatar clst commented on May 31, 2024

Yes it works fine, until you do something like $("input-container").html(newstuff); Then it needs bubbles: true.

At least it did in my case. I can check it again outside of my site, to be sure. Thanks for the quick reply and the great switch.

from lc-switch.

Related Issues (15)

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.