mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 21:48:42 +08:00
docs(list): clean up docs and hide gestureCtrl
This commit is contained in:
@ -20,7 +20,7 @@ export class ItemSlidingGesture extends PanGesture {
|
|||||||
super(list.getNativeElement(), {
|
super(list.getNativeElement(), {
|
||||||
maxAngle: MAX_ATTACK_ANGLE,
|
maxAngle: MAX_ATTACK_ANGLE,
|
||||||
threshold: DRAG_THRESHOLD,
|
threshold: DRAG_THRESHOLD,
|
||||||
gesture: list.gestureCtrl.create('item-sliding', {
|
gesture: list._gestureCtrl.create('item-sliding', {
|
||||||
priority: GesturePriority.SlidingItem,
|
priority: GesturePriority.SlidingItem,
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
@ -20,6 +20,25 @@ import { GestureController } from '../../gestures/gesture-controller';
|
|||||||
*
|
*
|
||||||
* @demo /docs/v2/demos/list/
|
* @demo /docs/v2/demos/list/
|
||||||
* @see {@link /docs/v2/components#lists List Component Docs}
|
* @see {@link /docs/v2/components#lists List Component Docs}
|
||||||
|
* @advanced
|
||||||
|
*
|
||||||
|
* Enable the sliding items.
|
||||||
|
*
|
||||||
|
* ```ts
|
||||||
|
* import { Component, ViewChild } from '@angular/core';
|
||||||
|
* import { List } from 'ionic-angular';
|
||||||
|
*
|
||||||
|
* @Component({...})
|
||||||
|
* export class MyClass {
|
||||||
|
* @ViewChild(List) list: List;
|
||||||
|
*
|
||||||
|
* constructor() { }
|
||||||
|
*
|
||||||
|
* stopSliding() {
|
||||||
|
* this.list.enableSlidingItems(false);
|
||||||
|
* }
|
||||||
|
* }
|
||||||
|
* ```
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Directive({
|
@Directive({
|
||||||
@ -33,7 +52,7 @@ export class List extends Ion {
|
|||||||
constructor(
|
constructor(
|
||||||
elementRef: ElementRef,
|
elementRef: ElementRef,
|
||||||
private _rendered: Renderer,
|
private _rendered: Renderer,
|
||||||
public gestureCtrl: GestureController) {
|
public _gestureCtrl: GestureController) {
|
||||||
super(elementRef);
|
super(elementRef);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,24 +64,7 @@ export class List extends Ion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enable the sliding items.
|
* @input {boolean} shouldEnable whether the item-sliding should be enabled or not
|
||||||
*
|
|
||||||
* ```ts
|
|
||||||
* import { Component, ViewChild } from '@angular/core';
|
|
||||||
* import { List } from 'ionic-angular';
|
|
||||||
*
|
|
||||||
* @Component({...})
|
|
||||||
* export class MyClass {
|
|
||||||
* @ViewChild(List) list: List;
|
|
||||||
*
|
|
||||||
* constructor() { }
|
|
||||||
*
|
|
||||||
* stopSliding() {
|
|
||||||
* this.list.enableSlidingItems(false);
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
* @param {boolean} shouldEnable whether the item-sliding should be enabled or not
|
|
||||||
*/
|
*/
|
||||||
@Input()
|
@Input()
|
||||||
get sliding(): boolean {
|
get sliding(): boolean {
|
||||||
@ -98,23 +100,7 @@ export class List extends Ion {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close the open sliding item.
|
* Close any sliding items that are open.
|
||||||
*
|
|
||||||
* ```ts
|
|
||||||
* import { Component, ViewChild } from '@angular/core';
|
|
||||||
* import { List } from 'ionic-angular';
|
|
||||||
*
|
|
||||||
* @Component({...})
|
|
||||||
* export class MyClass {
|
|
||||||
* @ViewChild(List) list: List;
|
|
||||||
*
|
|
||||||
* constructor() { }
|
|
||||||
*
|
|
||||||
* closeItems() {
|
|
||||||
* this.list.closeSlidingItems();
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* ```
|
|
||||||
*/
|
*/
|
||||||
closeSlidingItems() {
|
closeSlidingItems() {
|
||||||
this._slidingGesture && this._slidingGesture.closeOpened();
|
this._slidingGesture && this._slidingGesture.closeOpened();
|
||||||
|
Reference in New Issue
Block a user