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