diff --git a/src/components/content/content.ts b/src/components/content/content.ts index 3fd88d5816..bb4b1a4600 100644 --- a/src/components/content/content.ts +++ b/src/components/content/content.ts @@ -78,14 +78,16 @@ export class Content extends Ion { private _footerEle: HTMLElement; /** - * @private + * A number representing how many pixels the top of the content has been + * adjusted, which could be by either padding or margin. */ - adjustedTop: number; + contentTop: number; /** - * @private + * A number representing how many pixels the bottom of the content has been + * adjusted, which could be by either padding or margin. */ - adjustedBottom: number; + contentBottom: number; constructor( private _elementRef: ElementRef, @@ -526,9 +528,9 @@ export class Content extends Ion { if (this._tabbarPlacement === 'top') { newVal += this._tabbarHeight; } - if (newVal !== this.adjustedTop) { + if (newVal !== this.contentTop) { scrollEle.style.paddingTop = (newVal > 0 ? newVal + 'px' : ''); - this.adjustedTop = newVal; + this.contentTop = newVal; } newVal = this._footerHeight + this._paddingBottom; @@ -539,9 +541,9 @@ export class Content extends Ion { this._footerEle.style.bottom = (newVal - this._footerHeight - this._paddingBottom) + 'px'; } } - if (newVal !== this.adjustedBottom) { + if (newVal !== this.contentBottom) { scrollEle.style.paddingBottom = (newVal > 0 ? newVal + 'px' : ''); - this.adjustedBottom = newVal; + this.contentBottom = newVal; } } else { @@ -550,18 +552,18 @@ export class Content extends Ion { if (this._tabbarPlacement === 'top') { newVal += this._tabbarHeight; } - if (newVal !== this.adjustedTop) { + if (newVal !== this.contentTop) { scrollEle.style.marginTop = (newVal > 0 ? newVal + 'px' : ''); - this.adjustedTop = newVal; + this.contentTop = newVal; } newVal = this._footerHeight; if (this._tabbarPlacement === 'bottom') { newVal += this._tabbarHeight; } - if (newVal !== this.adjustedBottom) { + if (newVal !== this.contentBottom) { scrollEle.style.marginBottom = (newVal > 0 ? newVal + 'px' : ''); - this.adjustedBottom = newVal; + this.contentBottom = newVal; if (newVal > 0 && this._footerEle) { this._footerEle.style.bottom = (newVal - this._footerHeight) + 'px'; diff --git a/src/components/refresher/refresher.ts b/src/components/refresher/refresher.ts index 7e465648db..eda4e1c406 100644 --- a/src/components/refresher/refresher.ts +++ b/src/components/refresher/refresher.ts @@ -219,8 +219,8 @@ export class Refresher { let coord = pointerCoord(ev); console.debug('Pull-to-refresh, onStart', ev.type, 'y:', coord.y); - if (this._content.adjustedTop > 0) { - let newTop = this._content.adjustedTop + 'px'; + if (this._content.contentTop > 0) { + let newTop = this._content.contentTop + 'px'; if (this._top !== newTop) { this._top = newTop; }