Skip to content

Commit

Permalink
Describe the notify method (#7335)
Browse files Browse the repository at this point in the history
* Describe the `notify` method

* Add an illustration
  • Loading branch information
RomanTsukanov committed Nov 21, 2023
1 parent 85212ab commit f1ab8c5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/survey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,8 @@ export class SurveyModel extends SurveyElementCore
*
* - `"advanced"`\
* An advanced header view applies the same properties as the basic view, plus [header settings](https://surveyjs.io/form-library/documentation/api-reference/iheader) from the [survey theme](https://surveyjs.io/form-library/documentation/api-reference/itheme#header). The advanced view features a more flexible header layout, a capability to specify a background image, and other settings that give a more professional look to the survey header.
*
* [View Demo](https://surveyjs.io/form-library/examples/brand-your-survey-header/ (linkStyle))
*/
@property({
onSet: (newValue, target: SurveyModel) => {
Expand Down Expand Up @@ -3291,6 +3293,16 @@ export class SurveyModel extends SurveyElementCore
this.notify(this.completedStateText, this.completedState, value === "error");
}
}
/**
* Displays a toast notification with a specified message.
*
* Depending on the `type` argument, a survey can display the following notification types:
*
* ![Toast notification types in SurveyJS Form Library](https://surveyjs.io//Content/Images/docs/notification-types.png)
* @param message A message to display.
* @param type A notification type: `"info"` (default), `"success"`, or `"error"`.
* @param showActions For internal use.
*/
public notify(message: string, type: string, showActions: boolean = false): void {
this.notifier.showActions = showActions;
this.notifier.notify(message, type, showActions);
Expand Down

0 comments on commit f1ab8c5

Please sign in to comment.