Fixed test

This commit is contained in:
dotnetnerd
2014-01-24 09:42:26 +01:00
parent 1050f83bf3
commit 2c3666e48b
2 changed files with 9 additions and 13 deletions

View File

@@ -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);

View File

@@ -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;
}