can-control-processor-capture
v1.0.1
Published
An event processor for CanJS
Downloads
213
Readme
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');