mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
Fixed test
This commit is contained in:
@@ -1,19 +1,15 @@
|
||||
/// <reference path="ftdomdelegate.d.ts" />
|
||||
|
||||
function handleButtonClicks(event) {
|
||||
// Do some things
|
||||
}
|
||||
|
||||
function handleTouchMove(event) {
|
||||
// Do some other things
|
||||
}
|
||||
|
||||
window.addEventListener('load', function() {
|
||||
var delegate = new Delegate(document.body);
|
||||
delegate.on('click', 'button', handleButtonClicks);
|
||||
delegate.on('click', 'button', function(event) {
|
||||
// Do some things
|
||||
}
|
||||
);
|
||||
|
||||
// Listen to all touch move
|
||||
// events that reach the body
|
||||
delegate.on('touchmove', handleTouchMove);
|
||||
|
||||
delegate.on('touchmove', function(event) {
|
||||
// Do some other things
|
||||
});
|
||||
}, false);
|
||||
4
ftdomdelegate/ftdomdelegate.d.ts
vendored
4
ftdomdelegate/ftdomdelegate.d.ts
vendored
@@ -8,7 +8,7 @@ declare class Delegate
|
||||
{
|
||||
constructor(element: HTMLElement);
|
||||
|
||||
on(eventType: string, selector: string, callback : () => any) : void;
|
||||
on(eventType: string, selector: string, callback : (event : any) => any) : void;
|
||||
|
||||
on(eventType: string, callback:() => any) : void;
|
||||
on(eventType: string, callback:(event : any) => any) : void;
|
||||
}
|
||||
Reference in New Issue
Block a user