mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 20:33:32 +08:00
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> ```
This commit is contained in:
@ -45,6 +45,7 @@ export let CSS: {
|
||||
transform?: string,
|
||||
transition?: string,
|
||||
transitionDuration?: string,
|
||||
transitionDelay?: string,
|
||||
transitionTimingFn?: string,
|
||||
transitionStart?: string,
|
||||
transitionEnd?: string,
|
||||
@ -80,6 +81,9 @@ export let CSS: {
|
||||
// transition timing function
|
||||
CSS.transitionTimingFn = (isWebkit ? '-webkit-' : '') + 'transition-timing-function';
|
||||
|
||||
// transition delay
|
||||
CSS.transitionDelay = (isWebkit ? '-webkit-' : '') + 'transition-delay';
|
||||
|
||||
// To be sure transitionend works everywhere, include *both* the webkit and non-webkit events
|
||||
CSS.transitionEnd = (isWebkit ? 'webkitTransitionEnd ' : '') + 'transitionend';
|
||||
})();
|
||||
@ -156,7 +160,7 @@ export function windowLoad(callback?: Function) {
|
||||
return promise;
|
||||
}
|
||||
|
||||
export function pointerCoord(ev): {x: number, y: number} {
|
||||
export function pointerCoord(ev: any): {x: number, y: number} {
|
||||
// get coordinates for either a mouse click
|
||||
// or a touch depending on the given event
|
||||
let c = { x: 0, y: 0 };
|
||||
@ -243,7 +247,6 @@ export function closest(ele: HTMLElement, selector: string, checkSelf?: boolean)
|
||||
/**
|
||||
* Get the element offsetWidth and offsetHeight. Values are cached
|
||||
* to reduce DOM reads. Cache is cleared on a window resize.
|
||||
* @param {TODO} ele TODO
|
||||
*/
|
||||
export function getDimensions(ele: HTMLElement, id: string): {
|
||||
width: number, height: number, left: number, top: number
|
||||
@ -268,6 +271,10 @@ export function getDimensions(ele: HTMLElement, id: string): {
|
||||
return dimensions;
|
||||
}
|
||||
|
||||
export function clearDimensions(id: string) {
|
||||
delete dimensionCache[id];
|
||||
}
|
||||
|
||||
export function windowDimensions(): {width: number, height: number} {
|
||||
if (!dimensionCache.win) {
|
||||
// make sure we got good values before caching
|
||||
|
Reference in New Issue
Block a user