Files
Adam Bradley 91df5f97ee refactor(refresher): allow refresher content customization
Breaking Change:

## Refresher:

- `<ion-refresher>` now takes a child `<ion-refresher-content>`
component.
- Custom refresh content components can now be replaced for Ionic's
default refresher content.
- Properties `pullingIcon`, `pullingText` and `refreshingText` have
been moved to the `<ion-refresher-content>` component.
- `spinner` property has been renamed to `refreshingSpinner` and now
goes on the `<ion-refresher-content>` component.
- `refreshingIcon` property is no longer an input, but instead
`refreshingSpinner` should be used.

Was:

```
<ion-refresher (refresh)="doRefresh($event)"
pullingIcon="arrow-dropdown">
</ion-refresher>
```

Now:

```
<ion-refresher (refresh)="doRefresh($event)">
  <ion-refresher-content
pullingIcon="arrow-dropdown"></ion-refresher-content>
</ion-refresher>
```
2016-02-27 17:33:59 -06:00

45 lines
1001 B
TypeScript

import {ElementRef} from 'angular2/core';
import * as dom from '../util/dom';
let ids:number = 0;
/**
* Base class for all Ionic components. Exposes some common functionality
* that all Ionic components need, such as accessing underlying native elements and
* sending/receiving app-level events.
*/
export class Ion {
private _id: string;
constructor(protected elementRef: ElementRef) {
this._id = 'i' + ids++;
}
getElementRef(): ElementRef {
return this.elementRef;
}
getNativeElement(): any {
return this.elementRef.nativeElement;
}
getDimensions(): {
width: number, height: number, left: number, top: number
} {
return dom.getDimensions(this.elementRef.nativeElement, this._id);
}
width(): number {
return dom.getDimensions(this.elementRef.nativeElement, this._id).width;
}
height(): number {
return dom.getDimensions(this.elementRef.nativeElement, this._id).height;
}
ngOnDestroy() {
dom.clearDimensions(this._id);
}
}