Skip to content

Commit

Permalink
Add close target to slideover with animations
Browse files Browse the repository at this point in the history
  • Loading branch information
excid3 committed Aug 4, 2023
1 parent e926a95 commit 6ee44d9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# 4.0.1

* Tabs index now selects panels and no longer requires tabs
* Add closeTarget to Slideover

# 4.0.0

Expand Down
3 changes: 2 additions & 1 deletion src/slideover.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import Dropdown from './dropdown.js'
import { toggleWithState } from './transition'

export default class extends Dropdown {
static targets = ['menu', 'overlay']
static targets = ['menu', 'overlay', 'close']

openValueChanged() {
toggleWithState(this.overlayTarget, this.openValue)
toggleWithState(this.menuTarget, this.openValue)
if (this.hasCloseTarget) toggleWithState(this.closeTarget, this.openValue)
}
}

0 comments on commit 6ee44d9

Please sign in to comment.