Skip to content

Commit

Permalink
Scrollable logs, auto-scroll to bottom.
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelcrisis committed Apr 12, 2021
1 parent cd3cc40 commit 930683b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions scripts/_tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ module.exports = tS => {
if (this.logBook.length > 50) this.logBook.shift()

let logger = $('#ts_logs')[0]
let copied = [ ...this.logBook ]
if (logger) logger.innerHTML = copied.reverse().join('<br>')
if (logger) {
logger.innerHTML = this.logBook.join('<br>')
logger.scrollTop = logger.scrollHeight
}
}

// portals to tt
Expand Down
5 changes: 4 additions & 1 deletion turnStyles.sass
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,15 @@ input.ts_inputs
color: gold

#ts_logs
height: 200px
display: none
overflow: auto
font-size: 0.85em
font-weight: normal
margin-bottom: 40px
padding: 0 5px 0 20px
font-family: monospace
padding: 10px 5px 10px 20px
background: rgba(0,0,0,0.2)

span
display: block
Expand Down

0 comments on commit 930683b

Please sign in to comment.