Skip to content

Commit 99c50a1

Browse files
committed
fix(footer): show footer toolbar w/ tabbar bottom
1 parent f7880c9 commit 99c50a1

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

src/components/content/content.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,10 @@ export class Content extends Ion {
7272
private _inputPolling: boolean = false;
7373
private _scroll: ScrollView;
7474
private _scLsn: Function;
75-
private _scrollEle: HTMLElement;
7675
private _sbPadding: boolean;
7776
private _fullscreen: boolean;
77+
private _scrollEle: HTMLElement;
78+
private _footerEle: HTMLElement;
7879

7980
/**
8081
* @private
@@ -128,7 +129,7 @@ export class Content extends Ion {
128129
ngOnDestroy() {
129130
this._scLsn && this._scLsn();
130131
this._scroll && this._scroll.destroy();
131-
this._scrollEle = this._scLsn = null;
132+
this._scrollEle = this._footerEle = this._scLsn = null;
132133
}
133134

134135
/**
@@ -478,6 +479,7 @@ export class Content extends Ion {
478479

479480
} else if (ele.tagName === 'ION-FOOTER') {
480481
this._footerHeight = ele.clientHeight;
482+
this._footerEle = ele;
481483
}
482484
}
483485

@@ -506,6 +508,7 @@ export class Content extends Ion {
506508
*/
507509
writeDimensions() {
508510
let newVal: number;
511+
let scrollEle = this._scrollEle;
509512

510513
// only write when it has changed
511514
if (this._fullscreen) {
@@ -519,7 +522,7 @@ export class Content extends Ion {
519522
newVal += this._tabbarHeight;
520523
}
521524
if (newVal !== this.adjustedTop) {
522-
this._scrollEle.style.paddingTop = (newVal > 0 ? newVal + 'px' : '');
525+
scrollEle.style.paddingTop = (newVal > 0 ? newVal + 'px' : '');
523526
this.adjustedTop = newVal;
524527
}
525528

@@ -528,8 +531,12 @@ export class Content extends Ion {
528531
newVal += this._tabbarHeight;
529532
}
530533
if (newVal !== this.adjustedBottom) {
531-
this._scrollEle.style.paddingBottom = (newVal > 0 ? newVal + 'px' : '');
534+
scrollEle.style.paddingBottom = (newVal > 0 ? newVal + 'px' : '');
532535
this.adjustedBottom = newVal;
536+
537+
if (newVal > 0 && this._footerEle) {
538+
this._footerEle.style.bottom = (newVal - this._footerHeight) + 'px';
539+
}
533540
}
534541

535542
} else {
@@ -539,7 +546,7 @@ export class Content extends Ion {
539546
newVal += this._tabbarHeight;
540547
}
541548
if (newVal !== this.adjustedTop) {
542-
this._scrollEle.style.marginTop = (newVal > 0 ? newVal + 'px' : '');
549+
scrollEle.style.marginTop = (newVal > 0 ? newVal + 'px' : '');
543550
this.adjustedTop = newVal;
544551
}
545552

@@ -548,8 +555,12 @@ export class Content extends Ion {
548555
newVal += this._tabbarHeight;
549556
}
550557
if (newVal !== this.adjustedBottom) {
551-
this._scrollEle.style.marginBottom = (newVal > 0 ? newVal + 'px' : '');
558+
scrollEle.style.marginBottom = (newVal > 0 ? newVal + 'px' : '');
552559
this.adjustedBottom = newVal;
560+
561+
if (newVal > 0 && this._footerEle) {
562+
this._footerEle.style.bottom = (newVal - this._footerHeight) + 'px';
563+
}
553564
}
554565
}
555566

0 commit comments

Comments
 (0)