Fix scroll

This commit is contained in:
Florian Mounier
2016-09-29 17:15:38 +02:00
parent 64a8480938
commit 7d7f05e164
3 changed files with 8 additions and 3 deletions

View File

@@ -164,11 +164,14 @@
if (indexOf.call(line.classList, 'extended') >= 0) {
results.push(line.addEventListener('click', (function(line) {
return function() {
var after, before;
if (indexOf.call(line.classList, 'expanded') >= 0) {
return line.classList.remove('expanded');
} else {
before = line.getBoundingClientRect().height;
line.classList.add('expanded');
return butterfly.nativeScrollTo();
after = line.getBoundingClientRect().height;
return document.body.scrollTop += after - before;
}
};
})(line)));

File diff suppressed because one or more lines are too long

View File

@@ -5,5 +5,7 @@ Terminal.on 'change', (lines) ->
if 'expanded' in line.classList
line.classList.remove 'expanded'
else
before = line.getBoundingClientRect().height
line.classList.add 'expanded'
butterfly.nativeScrollTo()
after = line.getBoundingClientRect().height
document.body.scrollTop += after - before