Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

on anchor clicked contract change #1924

Merged
merged 15 commits into from Sep 19, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions source/nodejs/adaptivecards/src/card-elements.ts
Expand Up @@ -5014,11 +5014,11 @@ function raiseImageLoadedEvent(image: Image) {
}
}

function raiseAnchorClickedEvent(textBlock: TextBlock, anchor: HTMLAnchorElement): boolean {
let card = textBlock.getRootElement() as AdaptiveCard;
function raiseAnchorClickedEvent(element: CardElement, anchor: HTMLAnchorElement): boolean {
let card = element.getRootElement() as AdaptiveCard;
let onAnchorClickedHandler = (card && card.onAnchorClicked) ? card.onAnchorClicked : AdaptiveCard.onAnchorClicked;

return onAnchorClickedHandler != null ? onAnchorClickedHandler(textBlock, anchor) : false;
return onAnchorClickedHandler != null ? onAnchorClickedHandler(element, anchor) : false;
}

function raiseExecuteActionEvent(action: Action) {
Expand Down Expand Up @@ -5325,7 +5325,7 @@ export class AdaptiveCard extends ContainerWithActions {
static readonly elementTypeRegistry = new ElementTypeRegistry();
static readonly actionTypeRegistry = new ActionTypeRegistry();

static onAnchorClicked: (textBlock: TextBlock, anchor: HTMLAnchorElement) => boolean = null;
static onAnchorClicked: (elementd: CardElement, anchor: HTMLAnchorElement) => boolean = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

elementd --> element

static onExecuteAction: (action: Action) => void = null;
static onElementVisibilityChanged: (element: CardElement) => void = null;
static onImageLoaded: (image: Image) => void = null;
Expand Down Expand Up @@ -5417,7 +5417,7 @@ export class AdaptiveCard extends ContainerWithActions {
return true;
}

onAnchorClicked: (textBlock: TextBlock, anchor: HTMLAnchorElement) => boolean = null;
onAnchorClicked: (element: CardElement, anchor: HTMLAnchorElement) => boolean = null;
onExecuteAction: (action: Action) => void = null;
onElementVisibilityChanged: (element: CardElement) => void = null;
onImageLoaded: (image: Image) => void = null;
Expand Down