Skip to content

Commit

Permalink
🐞 fix autoslide issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielstuff committed Sep 20, 2019
1 parent afe4cc4 commit 6398598
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/piano.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ class Piano {

document.body.classList.add('piano-open')
this.settings.autoScroll && this.scrollWindow()
if (this.slideContent) {
document.querySelector(this.slideContainer).style.top = '-' + (rowsContainer.getBoundingClientRect().height / 2) + 'px'
if (this.settings.slideContent) {
document.querySelector(this.settings.slideContainer).style.top = '-' + (rowsContainer.getBoundingClientRect().height / 2) + 'px'
}
}

Expand Down Expand Up @@ -265,8 +265,8 @@ class Piano {
typeof this.settings.onHidden === 'function' && this.settings.onHidden()
}, this.container.style.animationDuration * 1000 || 300)
document.body.classList.remove('piano-open')
if (this.slideContent) {
document.querySelector(this.slideContainer).style.top = 0
if (this.settings.slideContent) {
document.querySelector(this.settings.slideContainer).style.top = 0
}
}
}
Expand All @@ -278,8 +278,8 @@ class Piano {
this.container.className = 'piano-container animated'
this.currentKeyboard = null
document.body.classList.remove('piano-open')
if (this.slideContent) {
document.querySelector(this.slideContainer).style.top = 0
if (this.settings.slideContent) {
document.querySelector(this.settings.slideContainer).style.top = 0
}
}
}
Expand Down

0 comments on commit 6398598

Please sign in to comment.