Skip to content

Commit fcf30f6

Browse files
committed
Add the import statement to the dialog examples
1 parent 67a84fe commit fcf30f6

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/javascript/components_confirmation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ You can exclude extra information or form elements in confirmation dialogs, but
88
## Example
99

1010
```ts
11+
import { confirmationFactory } from "WoltLabSuite/Core/Component/Confirmation";
12+
1113
const result = await confirmationFactory()
1214
.custom("Do you want a cookie?")
1315
.withoutMessage();

docs/javascript/components_dialog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Dialogs may contain just an explanation or extra information that should be pres
2121
The dialog can be closed via the “X” button or by clicking the modal backdrop.
2222

2323
```ts
24+
import { dialogFactory } from "WoltLabSuite/Core/Component/Dialog";
25+
2426
const dialog = dialogFactory().fromHtml("<p>Hello World</p>").withoutControls();
2527
dialog.show("Greetings from my dialog");
2628
```
@@ -43,6 +45,8 @@ An alert will only provide a single button to acknowledge the dialog and must no
4345
The dialog itself will be limited to a width of 500px, the title can wrap into multiple lines and there will be no “X” button to close the dialog.
4446

4547
```ts
48+
import { dialogFactory } from "WoltLabSuite/Core/Component/Dialog";
49+
4650
const dialog = dialogFactory()
4751
.fromHtml("<p>ERROR: Something went wrong!</p>")
4852
.asAlert();
@@ -106,6 +110,8 @@ A possible use case for an “extra” button would be a dialog that includes an
106110
```
107111

108112
```ts
113+
import { dialogFactory } from "WoltLabSuite/Core/Component/Dialog";
114+
109115
document.getElementById("showMyDialog")!.addEventListener("click", () => {
110116
const dialog = dialogFactory().fromId("myDialog").asPrompt();
111117

0 commit comments

Comments
 (0)