1.0.1 • Published 10 years ago

can-control-processor-capture v1.0.1

Weekly downloads
72
License
ISC
Repository
github
Last release
10 years ago

npm version

An event processor for CanJS

Allows to subscribe to the capture phase of DOM events. Extends can.Control.processors.

Note: does not support event delegation yet.

Usage

With can.Component

<my-component></my-component>

can.Component.extend({
  tag: 'my-component',
  viewModel: {},
  events: {
    '{document} click capture': function(){
      console.log('{document} click capture', arguments);
    }
  }
});

With pure can.Control

<div id="app">
  <button>Click</button>
</div>

let MyControl = can.Control.extend({
    'button click capture': function(){
        console.log('button click capture', arguments);
    },
    '{document} click capture': function(){
        console.log('{document} click capture', arguments);
    }
});
new MyControl('#app');
1.0.1

10 years ago

1.0.0

10 years ago