44 lines
1.3 KiB
Markdown
44 lines
1.3 KiB
Markdown
# Usage: v0.1.0.029a
|
|
|
|
This is the usage guide for [BSDialog](/bootstrapjs-bsdialog), v0.1.0.029a.
|
|
|
|
## Usage
|
|
|
|
### Create(id, title, url, [is_big], [update_body])
|
|
|
|
| Parameter | Type | Description |
|
|
|-----------|------|-------------|
|
|
| id | string | Unique identifier for the modal, so you can refer to multiple modal |
|
|
| title | string | Label at the top of the modal |
|
|
| url | string | URL to load into the modal body |
|
|
| is_big | boolean | Use large width or small width on the modal. (Optional. Default is false) |
|
|
| update_body | boolean | Update modal-body with content, otherwise model-content. (Optional. Default is false) |
|
|
|
|
Creates the Modal on the page and loads the body from a URL. An existing box will be reused if the ID already exists.
|
|
|
|
```javascript
|
|
BSDialog.Create("123", "My Modal Box 123", "/my-modal-box.html");
|
|
BSDialog.Create("123", "My Modal Box 123", "/my-modal-box.html", false);
|
|
BSDialog.Create("123", "My Modal Box 123", "/my-modal-box.html", false, false);
|
|
```
|
|
|
|
### Close(id)
|
|
|
|
| Parameter | Type | Description |
|
|
|-----------|------|-------------|
|
|
| id | string | Unique identifier for the modal, so you can refer to multiple modal |
|
|
|
|
Close the Modal box by the box identifier.
|
|
|
|
```javascript
|
|
BSDialog.Close("123");
|
|
```
|
|
|
|
### Clear()
|
|
|
|
Close all Modal boxes on the page.
|
|
|
|
```javascript
|
|
BSDialog.Clear();
|
|
```
|