FIX: Docking of progress component on iOS was a bit off

This commit is contained in:
Robin Ward 2017-06-19 15:53:29 -04:00
parent 14256e11e7
commit 394efb3290
1 changed files with 9 additions and 4 deletions

View File

@ -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;