Git Product home page Git Product logo

mquery's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

nemetris h-lo

mquery's Issues

Include automatic data and events cleaning on empty

A great feature of jQuery when dealing with memory leaks was that it automatically cleaned data attributes and event listeners when nodes are removed or emptied.

Could you add this also to the empty and other dom node cleaning methods in this library?

Add support for event delegation

It will be very useful to be able to do event delegation the jQuery way. This will greatly increase the speed of handling events - as you will handle them in a central place.

https://javascript.info/event-delegation

https://learn.jquery.com/events/event-delegation/

Maybe by passing a delegate: 'elem-selector' in the options of on() ?

it can be easily done with css selctor matches, like:

https://gomakethings.com/event-delegation-and-multiple-selectors-with-vanilla-js/

Show / Hide should remember and restore original display value

JQuery and Cash store the original display value and restore it again correctly.

Currently mQuery sets the display value to none/inherit, which can often be wrong, e.g. if the original display value was flex or hidden.

JQuery uses some sort of private cache: https://github.com/jquery/jquery/blob/a684e6ba836f7c553968d7d026ed7941e1a612d8/src/css/showHide.js

Cash uses some combination of storing the display value in a ___cd property on the element and calculating the display value based on inserting a temporary DOM element: https://github.com/fabiospampinato/cash/blob/1c1b316e53cc3322e417a93a0e7c4745852796d0/dist/cash.ts

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.