refactor(content): rename adjustedTop to contentTop

Closes #7112
This commit is contained in:
Adam Bradley
2016-06-29 21:51:11 -05:00
parent 7f83445b59
commit 0d8c947409
2 changed files with 16 additions and 14 deletions

View File

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

View File

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