Skip to content

Commit

Permalink
view: only autoscroll if at bottom of container
Browse files Browse the repository at this point in the history
so we can keep the user from losing his or her place
  • Loading branch information
evanlucas committed Apr 1, 2016
1 parent 07f3a1f commit 0974c45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ function App(el, currentWindow) {
if (this.activeModel.ele) {
const ele = document.querySelector(this.activeModel.ele)
if (ele) {
ele.scrollTop = ele.scrollHeight
if (ele.scrollHeight - ele.clientHeight <= ele.scrollTop + 1) {
ele.scrollTop = ele.scrollHeight
}
}
} else if (this.activeModel instanceof Settings) {
const ele = document.querySelector('.settings-container')
Expand Down

0 comments on commit 0974c45

Please sign in to comment.