From 394efb329022285950fdf71102a5e1ae7223c364 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Mon, 19 Jun 2017 15:53:29 -0400 Subject: [PATCH] FIX: Docking of progress component on iOS was a bit off --- .../discourse/components/topic-progress.js.es6 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/components/topic-progress.js.es6 b/app/assets/javascripts/discourse/components/topic-progress.js.es6 index 9e48d70c2f1..33652613de9 100644 --- a/app/assets/javascripts/discourse/components/topic-progress.js.es6 +++ b/app/assets/javascripts/discourse/components/topic-progress.js.es6 @@ -110,11 +110,10 @@ export default Ember.Component.extend({ }, _dock() { - const maximumOffset = $('#topic-footer-buttons').offset(), + const maximumOffset = $('#topic-bottom').offset(), composerHeight = $('#reply-control').height() || 0, $topicProgressWrapper = this.$(), - offset = window.pageYOffset || $('html').scrollTop(), - topicProgressHeight = $('#topic-progress').height(); + offset = window.pageYOffset || $('html').scrollTop(); if (!$topicProgressWrapper || $topicProgressWrapper.length === 0) { return; @@ -124,7 +123,13 @@ export default Ember.Component.extend({ if (maximumOffset) { const threshold = maximumOffset.top; const windowHeight = $(window).height(); - isDocked = offset >= threshold - windowHeight + topicProgressHeight + composerHeight; + const headerHeight = $('header').outerHeight(true); + + if (this.capabilities.isIOS) { + isDocked = offset >= (threshold - windowHeight - headerHeight + composerHeight); + } else { + isDocked = offset >= (threshold - windowHeight + composerHeight); + } } const dockPos = $(document).height() - $('#topic-bottom').offset().top;