Skip to content

Commit

Permalink
Merge pull request #49 from viivue/2.2.0
Browse files Browse the repository at this point in the history
2.2.0
  • Loading branch information
phucbm authored Sep 7, 2023
2 parents 117202a + 4401806 commit 8a58382
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import "@viivue/easy-tab-accordion";

```html
<!-- JS (10KB) -->
<script src="https://cdn.jsdelivr.net/gh/viivue/easy-tab-accordion@2.1.7/dist/easy-tab-accordion.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/viivue/easy-tab-accordion@2.2.0/dist/easy-tab-accordion.min.js"></script>
```

## Initialize
Expand Down
4 changes: 2 additions & 2 deletions dist/easy-tab-accordion.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/easy-tab-accordion.module.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@viivue/easy-tab-accordion",
"filename": "easy-tab-accordion",
"prettyName": "Easy Tabs & Accordion",
"version": "2.1.7",
"version": "2.2.0",
"description": "Javascript library to create tabs or accordion.",
"homepage": "https://github.com/viivue/easy-tab-accordion",
"repository": {
Expand Down
19 changes: 16 additions & 3 deletions src/_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ export class EasyTabAccordion{
updateURL(this, id);

// events
this.events.fire('onBeforeOpen');
this.events.fire('onBeforeOpen', {
type: this.type,
current_id: this.current_id,
previous_id: this.previous_id,
});
};

// event: on Before Open
Expand All @@ -170,7 +174,12 @@ export class EasyTabAccordion{
this.isAnimating = false;
log(this, 'log', 'Stop animation.');

this.events.fire('onAfterOpen', {target});
this.events.fire('onAfterOpen', {
target,
type: this.type,
current_id: this.current_id,
previous_id: this.previous_id,
});

// log
log(this, 'log', 'after open', id);
Expand Down Expand Up @@ -207,7 +216,11 @@ export class EasyTabAccordion{
if(!validID(this, id)) return;

// event: on Before Close
this.events.fire('onBeforeClose');
this.events.fire('onBeforeClose', {
type: this.type,
current_id: this.current_id,
previous_id: this.previous_id,
});

// event: on After Close
this.dataset[getIndexById(this, id)].active = false;
Expand Down

0 comments on commit 8a58382

Please sign in to comment.