Skip to content

Commit

Permalink
chore!: rename onHighlightStarted to onBeforeHighlighted to make …
Browse files Browse the repository at this point in the history
…the naming more intuitive
  • Loading branch information
josias-r committed Nov 3, 2022
1 parent 8ae590d commit d530133
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ <h4>Boarding Definition</h4>
showButtons: false, // Do not show control buttons in footer
keyboardControl: true, // Allow controlling through keyboard (escape to close, arrow keys to move)
scrollIntoViewOptions: {}, // We use `scrollIntoView()` when possible, pass here the options for it if you want any
onHighlightStarted: (Element) {}, // Called when element is about to be highlighted
onBeforeHighlighted: (Element) {}, // Called when element is about to be highlighted
onHighlighted: (Element) {}, // Called when element is fully highlighted
onDeselected: (Element) {}, // Called when element has been deselected
onReset: (Element) {}, // Called when overlay is about to be cleared
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ const boarding = new Boarding({
showButtons: false, // Do not show control buttons in footer
keyboardControl: true, // Allow controlling through keyboard (escape to close, arrow keys to move)
scrollIntoViewOptions: {}, // We use `scrollIntoView()` when possible, pass here the options for it if you want any
onHighlightStarted: (HighlightElement) => {}, // Called when element is about to be highlighted
onBeforeHighlighted: (HighlightElement) => {}, // Called when element is about to be highlighted
onHighlighted: (HighlightElement) => {}, // Called when element is fully highlighted
onDeselected: (HighlightElement) => {}, // Called when element has been deselected
onReset: (HighlightElement) => {}, // Called when overlay is about to be cleared
Expand Down
4 changes: 2 additions & 2 deletions src/lib/boarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ class Boarding {
highlightDomElement: domElement,
options: {
scrollIntoViewOptions: this.options.scrollIntoViewOptions,
onHighlightStarted:
currentStep.onHighlightStarted || this.options.onHighlightStarted,
onBeforeHighlighted:
currentStep.onBeforeHighlighted || this.options.onBeforeHighlighted,
onHighlighted: currentStep.onHighlighted || this.options.onHighlighted,
onDeselected: currentStep.onDeselected || this.options.onDeselected,
onNext: currentStep.onNext || this.options.onNext,
Expand Down
6 changes: 3 additions & 3 deletions src/lib/core/highlight-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface HighlightElementHybridOptions
/**
* Callback to be called when element is about to be highlighted
*/
onHighlightStarted?: (element: HighlightElement) => void;
onBeforeHighlighted?: (element: HighlightElement) => void;
/**
* Callback to be called when element has been highlighted
*/
Expand Down Expand Up @@ -96,8 +96,8 @@ class HighlightElement {
/**
* Is called when the element is about to be highlighted
*/
public onHighlightStarted() {
this.options.onHighlightStarted?.(this);
public onBeforeHighlighted() {
this.options.onBeforeHighlighted?.(this);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/core/overlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Overlay {
// window.clearTimeout(this.hideTimer);

// Trigger the hook for highlight started
element.onHighlightStarted();
element.onBeforeHighlighted();

// Old element has been deselected
if (
Expand Down

0 comments on commit d530133

Please sign in to comment.