Skip to content

Commit

Permalink
[TASK] Remove the custom close event because the native HTML `dialo…
Browse files Browse the repository at this point in the history
…g` element has its own `close` event
  • Loading branch information
deoostfrees committed Jul 10, 2024
1 parent 98e41b5 commit dba4678
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ The following events are available:
| `close` | Triggered after Parvus has been closed |
| `destroy` | Triggered after Parvus has been destroyed |

Except for the `destroy` event, you can access the current source element using the `event.detail.source` property.
Except for the `close` and `destroy` events, you can access the current source element using the `event.detail.source` property.

```js
prvs.on('open', function (event) {
Expand Down
7 changes: 0 additions & 7 deletions dist/js/parvus.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,13 +523,6 @@ function Parvus(userOptions) {
IMAGE.addEventListener('transitionend', transitionendHandler, {
once: true
});

// Create and dispatch a new event
fire('close', {
detail: {
source: GROUPS[activeGroup].triggerElements[currentIndex]
}
});
};

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/js/parvus.esm.min.js

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions dist/js/parvus.js
Original file line number Diff line number Diff line change
Expand Up @@ -529,13 +529,6 @@
IMAGE.addEventListener('transitionend', transitionendHandler, {
once: true
});

// Create and dispatch a new event
fire('close', {
detail: {
source: GROUPS[activeGroup].triggerElements[currentIndex]
}
});
};

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/js/parvus.min.js

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions src/js/parvus.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,13 +519,6 @@ export default function Parvus (userOptions) {
}

IMAGE.addEventListener('transitionend', transitionendHandler, { once: true })

// Create and dispatch a new event
fire('close', {
detail: {
source: GROUPS[activeGroup].triggerElements[currentIndex]
}
})
}

/**
Expand Down

0 comments on commit dba4678

Please sign in to comment.