Giter Site home page Giter Site logo

event's Introduction

event

Element event binding component.

Installation

$ component install component/event

Example

var events = require('event');
var a = document.querySelector('a');

function onclick(e) {
  e.preventDefault();
  console.log(e.target);
  events.unbind(a, 'click', onclick);
}

events.bind(a, 'click', onclick);

API

.bind(el, type, callback, [capture])

Bind to el's event type with callback, returns the callback passed.

.unbind(el, type, callback, [capture])

Unbind el's event type callback, returns the callback passed.

License

MIT

event's People

Contributors

forbeslindesay avatar jfastnacht avatar jonathanong avatar kenany avatar necolas avatar pazguille avatar stagas avatar tj avatar tootallnate avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

event's Issues

rename?

maybe renamed to delegate since we need the stupid IE shims for addEventListener as well

Is there an interest for IE8 support?

The current implementation is unusable in IE8. Event handlers have no context, and event object doesn't have .target, .preventDefault, and .stopPropagation.

I'm aiming for at least 95% browser support in my projects, which right now (with IE8 9.6% market share according to statcounter) means all modern browsers + IE down to 8, so I'd need this library to be consistent with it.

The current PR #7 is trying to fix that but has some issues. I could put together a PR that patches them, but seeing that #7 has been open for 9 months without any reaction forces me to ask before wasting time.

The reason why I won't just create my own component is that I want to use the most popular components to achieve a project with minimum duplicate libraries with single purpose. In a case of event bindings it seems to be this one.

If there is no interest for IE8 support, to save me a future hassle, are all components in component/* namespace targeted for IE9+?

tester

I have a issue with Server error

Missing license information on npm

While the readme states that this project uses the MIT license, the npm package shows as "License: none" on https://www.npmjs.com/package/component-event/v/0.1.4.

This prevents the package being mirrored to Maven using WebJars and breaks the dependency tree for one of our projects.

Could you possibly add the license information for this package on npm? In particular we would need it on version 0.1.4.

Thanks in advance!

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.