From 722357fe998fbaca34dad4c0030a3ccd6438bd07 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 11 Aug 2015 16:37:53 -0700 Subject: [PATCH] Account for callbacks in 'fancybox'. --- fancybox/fancybox-tests.ts | 2 +- fancybox/fancybox.d.ts | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/fancybox/fancybox-tests.ts b/fancybox/fancybox-tests.ts index dce30bf439..d84a06815f 100644 --- a/fancybox/fancybox-tests.ts +++ b/fancybox/fancybox-tests.ts @@ -116,7 +116,7 @@ $(".fancybox").fancybox({ } }); $(".fancybox").fancybox({ - beforeLoad: function () { + beforeLoad: () => { this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : ''); } }); diff --git a/fancybox/fancybox.d.ts b/fancybox/fancybox.d.ts index 03a20bebf1..7182f7cadd 100644 --- a/fancybox/fancybox.d.ts +++ b/fancybox/fancybox.d.ts @@ -6,7 +6,7 @@ /// -interface FancyboxOptions { +interface FancyboxOptions extends FancyboxCallback { padding?: any; // number or [] margin?: any; // number or [] width?: any; // number or [] @@ -96,16 +96,16 @@ interface FancyboxMethods { } interface FancyboxCallback { - onCancel; - beforeLoad; - afterLoad; - beforeShow; - afterShow; - beforeClose; - afterClose; - onUpdate; - onPlayStart; - onPlayEnd; + onCancel?: Function; + beforeLoad?: Function; + afterLoad?: Function; + beforeShow?: Function; + afterShow?: Function; + beforeClose?: Function; + afterClose?: Function; + onUpdate?: Function; + onPlayStart?: Function; + onPlayEnd?: Function; } interface FancyboxThumbnailHelperOptions {