Skip to content

Commit

Permalink
Add id property
Browse files Browse the repository at this point in the history
  • Loading branch information
rynpsc committed Oct 28, 2020
1 parent 982ed3b commit 7ff517e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 4.2.0 - 2020-10-28

### Added

- Added the `id` property to access the instances id.

## 4.1.1 - 2020-09-21

### Fixed
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ Returns a boolean indicating if the dialog has been initiated.
dialog.isOpen;
```

#### `.id`

The ID that was passed into the constructor.

```js
dialog.id
```

#### `.element`

The HTMLElement matching the ID passed into the constructor.
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ export function dialog(dialog, options) {
create,
toggle,
destroy,
id: dialog,
element: dialogElement,
};

Expand Down

0 comments on commit 7ff517e

Please sign in to comment.