From 8037086650d3579c53b08afab4329034da09637b Mon Sep 17 00:00:00 2001 From: Brandy Carney Date: Wed, 7 Dec 2016 11:36:57 -0500 Subject: [PATCH] fix(content): add a new variable for calculating fixed content top/bottom This is to fix the fixed content getting the same padding from ion-content applied when fullscreen. It should not get padding. --- src/components/content/content.ts | 14 ++++++++++++-- src/components/nav/test/basic/app-module.ts | 4 ++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/components/content/content.ts b/src/components/content/content.ts index 6e9fa189989..d44135736ff 100644 --- a/src/components/content/content.ts +++ b/src/components/content/content.ts @@ -146,6 +146,10 @@ export class Content extends Ion implements OnDestroy, OnInit { /** @internal */ _tTop: number; /** @internal */ + _fTop: number; + /** @internal */ + _fBottom: number; + /** @internal */ _inputPolling: boolean = false; /** @internal */ _scroll: ScrollView; @@ -569,6 +573,8 @@ export class Content extends Ion implements OnDestroy, OnInit { this._ftrHeight = 0; this._tabsPlacement = null; this._tTop = 0; + this._fTop = 0; + this._fBottom = 0; let ele: HTMLElement = this._elementRef.nativeElement; if (!ele) { @@ -646,6 +652,10 @@ export class Content extends Ion implements OnDestroy, OnInit { this._cBottom += this._tabbarHeight; } + // Fixed content shouldn't include content padding + this._fTop = this._cTop; + this._fBottom = this._cBottom; + // Handle fullscreen viewport (padding vs margin) if (this._fullscreen) { this._cTop += this._pTop; @@ -706,8 +716,8 @@ export class Content extends Ion implements OnDestroy, OnInit { // Handle fullscreen viewport (padding vs margin) let topProperty = 'marginTop'; let bottomProperty = 'marginBottom'; - let fixedTop: number = this._cTop; - let fixedBottom: number = this._cBottom; + let fixedTop: number = this._fTop; + let fixedBottom: number = this._fBottom; if (this._fullscreen) { assert(this._pTop >= 0, '_paddingTop has to be positive'); diff --git a/src/components/nav/test/basic/app-module.ts b/src/components/nav/test/basic/app-module.ts index 3f94ffd1156..9807f23595e 100644 --- a/src/components/nav/test/basic/app-module.ts +++ b/src/components/nav/test/basic/app-module.ts @@ -387,8 +387,8 @@ export class FullPage {

- -
+ +