Skip to content

Commit

Permalink
fix(refresher): border should only show when pulled (ionic-team#12015)
Browse files Browse the repository at this point in the history
  • Loading branch information
Manduro authored and manucorporat committed Jun 12, 2017
1 parent a91a68e commit 47e3c70
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/components/content/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ export class EventEmitterProxy<T> extends EventEmitter<T> {
'</div>' +
'<ng-content select="ion-refresher"></ng-content>',
host: {
'[class.statusbar-padding]': 'statusbarPadding'
'[class.statusbar-padding]': 'statusbarPadding',
'[class.has-refresher]': '_hasRefresher'
},
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
Expand Down Expand Up @@ -212,6 +213,8 @@ export class Content extends Ion implements OnDestroy, AfterViewInit, IContent {
/** @internal */
_fullscreen: boolean;
/** @internal */
_hasRefresher: boolean = false;
/** @internal */
_footerEle: HTMLElement;
/** @internal */
_dirty: boolean;
Expand Down Expand Up @@ -782,6 +785,11 @@ export class Content extends Ion implements OnDestroy, AfterViewInit, IContent {
this._cBottom += this._tabbarHeight;
}

// Refresher uses a border which should be hidden unless pulled
if (this._hasRefresher) {
this._cTop -= 1;
}

// Fixed content shouldn't include content padding
this._fTop = this._cTop;
this._fBottom = this._cBottom;
Expand Down
2 changes: 1 addition & 1 deletion src/components/refresher/refresher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class Refresher {

constructor(private _plt: Platform, @Host() private _content: Content, private _zone: NgZone, gestureCtrl: GestureController) {
this._events = new UIEventManager(_plt);
_content.setElementClass('has-refresher', true);
_content._hasRefresher = true;
this._gesture = gestureCtrl.createGesture({
name: GESTURE_REFRESHER,
priority: GESTURE_PRIORITY_REFRESHER
Expand Down
3 changes: 3 additions & 0 deletions src/components/refresher/test/refresher.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ describe('Refresher', () => {

});

it('should set hasRefresher on content', () => {
expect(content._hasRefresher).toBeTruthy();
});

let contentElementRef: any;
let refresher: Refresher;
Expand Down

0 comments on commit 47e3c70

Please sign in to comment.