Skip to content

Commit

Permalink
fix(footer): show footer toolbar w/ tabbar bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdbradley committed Jun 22, 2016
1 parent f7880c9 commit 99c50a1
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/components/content/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ export class Content extends Ion {
private _inputPolling: boolean = false;
private _scroll: ScrollView;
private _scLsn: Function;
private _scrollEle: HTMLElement;
private _sbPadding: boolean;
private _fullscreen: boolean;
private _scrollEle: HTMLElement;
private _footerEle: HTMLElement;

/**
* @private
Expand Down Expand Up @@ -128,7 +129,7 @@ export class Content extends Ion {
ngOnDestroy() {
this._scLsn && this._scLsn();
this._scroll && this._scroll.destroy();
this._scrollEle = this._scLsn = null;
this._scrollEle = this._footerEle = this._scLsn = null;
}

/**
Expand Down Expand Up @@ -478,6 +479,7 @@ export class Content extends Ion {

} else if (ele.tagName === 'ION-FOOTER') {
this._footerHeight = ele.clientHeight;
this._footerEle = ele;
}
}

Expand Down Expand Up @@ -506,6 +508,7 @@ export class Content extends Ion {
*/
writeDimensions() {
let newVal: number;
let scrollEle = this._scrollEle;

// only write when it has changed
if (this._fullscreen) {
Expand All @@ -519,7 +522,7 @@ export class Content extends Ion {
newVal += this._tabbarHeight;
}
if (newVal !== this.adjustedTop) {
this._scrollEle.style.paddingTop = (newVal > 0 ? newVal + 'px' : '');
scrollEle.style.paddingTop = (newVal > 0 ? newVal + 'px' : '');
this.adjustedTop = newVal;
}

Expand All @@ -528,8 +531,12 @@ export class Content extends Ion {
newVal += this._tabbarHeight;
}
if (newVal !== this.adjustedBottom) {
this._scrollEle.style.paddingBottom = (newVal > 0 ? newVal + 'px' : '');
scrollEle.style.paddingBottom = (newVal > 0 ? newVal + 'px' : '');
this.adjustedBottom = newVal;

if (newVal > 0 && this._footerEle) {
this._footerEle.style.bottom = (newVal - this._footerHeight) + 'px';
}
}

} else {
Expand All @@ -539,7 +546,7 @@ export class Content extends Ion {
newVal += this._tabbarHeight;
}
if (newVal !== this.adjustedTop) {
this._scrollEle.style.marginTop = (newVal > 0 ? newVal + 'px' : '');
scrollEle.style.marginTop = (newVal > 0 ? newVal + 'px' : '');
this.adjustedTop = newVal;
}

Expand All @@ -548,8 +555,12 @@ export class Content extends Ion {
newVal += this._tabbarHeight;
}
if (newVal !== this.adjustedBottom) {
this._scrollEle.style.marginBottom = (newVal > 0 ? newVal + 'px' : '');
scrollEle.style.marginBottom = (newVal > 0 ? newVal + 'px' : '');
this.adjustedBottom = newVal;

if (newVal > 0 && this._footerEle) {
this._footerEle.style.bottom = (newVal - this._footerHeight) + 'px';
}
}
}

Expand Down

0 comments on commit 99c50a1

Please sign in to comment.