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

Step Element Target Action #996

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/js/step.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,22 @@ export class Step extends Evented {
}
}

/**
* Returns the element for the step
* @return {HTMLElement|null|undefined} The element instance. undefined if it has never been shown, null if it has been destroyed
*/
getElement() {
return this.el;
}

/**
* Returns the target for the step
* @return {HTMLElement|null|undefined} The element instance. undefined if it has never been shown, null if query string has not been found
*/
getTarget() {
return this.target;
}

/**
* Creates Shepherd element for step based on options
*
Expand Down
14 changes: 13 additions & 1 deletion src/types/step.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ declare class Step extends Evented {
* @param {Step.StepOptions} options to be updated
*/
updateStepOptions(options: Step.StepOptions): void;

/**
* Returns the element for the step
* @return The element instance. undefined if it has never been shown, null if it has been destroyed
*/
getElement(): HTMLElement | null | undefined

/**
* Returns the target for the step
* @returns The element instance. undefined if it has never been shown, null if query string has not been found
*/
getTarget(): HTMLElement | null | undefined
}

declare namespace Step {
Expand Down Expand Up @@ -231,7 +243,7 @@ declare namespace Step {
* }
* ```
*/
action?: (() => void);
action?: ((this: Tour) => void);

/**
* Extra classes to apply to the `<a>`
Expand Down