diff --git a/CHANGELOG.md b/CHANGELOG.md index 7410e8f..87725e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ # 4.0.1 * Tabs index now selects panels and no longer requires tabs +* Add closeTarget to Slideover # 4.0.0 diff --git a/src/slideover.js b/src/slideover.js index 94efae7..81b4d62 100644 --- a/src/slideover.js +++ b/src/slideover.js @@ -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) } }