FIX: The docked back button didn't work so well on iPad / short topics

This commit is contained in:
Robin Ward 2016-12-19 17:16:19 -05:00
parent 2b808ad9da
commit 8757ae3b92
1 changed files with 11 additions and 4 deletions

View File

@ -79,7 +79,9 @@ createWidget('timeline-scroller', {
},
dragEnd(e) {
if (!$(e.target).is('button')) {
if ($(e.target).is('button')) {
this.sendWidgetAction('goBack');
} else {
this.sendWidgetAction('commit');
}
}
@ -167,9 +169,14 @@ createWidget('timeline-scrollarea', {
if (hasBackPosition) {
const lastReadTop = Math.round(position.lastReadPercentage * SCROLLAREA_HEIGHT);
showButton = ((lastReadTop < before - (SCROLLER_HEIGHT * 0.5)) ||
(lastReadTop > (before + SCROLLER_HEIGHT))) &&
(lastReadTop < (SCROLLAREA_HEIGHT - SCROLLER_HEIGHT));
showButton = ((before + SCROLLER_HEIGHT - 5) < lastReadTop) ||
(before > (lastReadTop + 25));
// Don't show if at the bottom of the timeline
if (lastReadTop < (SCROLLAREA_HEIGHT - SCROLLER_HEIGHT)) {
showButton = false;
}
}
const result = [