paradoxxxzero_butterfly/coffees/ext/expand_extended.coffee
2016-10-13 10:03:15 +02:00

11 lines
400 B
CoffeeScript

Terminal.on 'change', (line) ->
if 'extended' in line.classList
line.addEventListener 'click', do (line) -> ->
if 'expanded' in line.classList
line.classList.remove 'expanded'
else
before = line.getBoundingClientRect().height
line.classList.add 'expanded'
after = line.getBoundingClientRect().height
document.body.scrollTop += after - before