Skip to content

fix(refresher): border should only show when pulled #12015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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