forked from mystiq/hydrogen-web
fallback from scrollBy() to setting scrollTop on IE11
This commit is contained in:
parent
02b8b37b4c
commit
8858cffc55
1 changed files with 5 additions and 1 deletions
|
@ -101,7 +101,11 @@ export class TimelineView extends TemplateView<TimelineViewModel> {
|
||||||
if (newAnchoredBottom !== this.anchoredBottom) {
|
if (newAnchoredBottom !== this.anchoredBottom) {
|
||||||
const bottomDiff = newAnchoredBottom - this.anchoredBottom;
|
const bottomDiff = newAnchoredBottom - this.anchoredBottom;
|
||||||
console.log(`restore: scroll by ${bottomDiff} as height changed`);
|
console.log(`restore: scroll by ${bottomDiff} as height changed`);
|
||||||
timeline.scrollBy(0, bottomDiff);
|
if (typeof timeline.scrollBy === "function") {
|
||||||
|
timeline.scrollBy(0, bottomDiff);
|
||||||
|
} else {
|
||||||
|
timeline.scrollTop = timeline.scrollTop + bottomDiff;
|
||||||
|
}
|
||||||
this.anchoredBottom = newAnchoredBottom;
|
this.anchoredBottom = newAnchoredBottom;
|
||||||
} else {
|
} else {
|
||||||
// console.log("restore: bottom didn't change, must be below viewport");
|
// console.log("restore: bottom didn't change, must be below viewport");
|
||||||
|
|
Loading…
Reference in a new issue