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(), {
|
||||
maxAngle: MAX_ATTACK_ANGLE,
|
||||
threshold: DRAG_THRESHOLD,
|
||||
gesture: list.gestureCtrl.create('item-sliding', {
|
||||
gesture: list._gestureCtrl.create('item-sliding', {
|
||||
priority: GesturePriority.SlidingItem,
|
||||
})
|
||||
});
|
||||
|
@ -20,6 +20,25 @@ import { GestureController } from '../../gestures/gesture-controller';
|
||||
*
|
||||
* @demo /docs/v2/demos/list/
|
||||
* @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({
|
||||
@ -33,7 +52,7 @@ export class List extends Ion {
|
||||
constructor(
|
||||
elementRef: ElementRef,
|
||||
private _rendered: Renderer,
|
||||
public gestureCtrl: GestureController) {
|
||||
public _gestureCtrl: GestureController) {
|
||||
super(elementRef);
|
||||
}
|
||||
|
||||
@ -45,24 +64,7 @@ export class List extends Ion {
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* @param {boolean} shouldEnable whether the item-sliding should be enabled or not
|
||||
* @input {boolean} shouldEnable whether the item-sliding should be enabled or not
|
||||
*/
|
||||
@Input()
|
||||
get sliding(): boolean {
|
||||
@ -98,23 +100,7 @@ export class List extends Ion {
|
||||
|
||||
|
||||
/**
|
||||
* Close the open sliding item.
|
||||
*
|
||||
* ```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();
|
||||
* }
|
||||
* }
|
||||
* ```
|
||||
* Close any sliding items that are open.
|
||||
*/
|
||||
closeSlidingItems() {
|
||||
this._slidingGesture && this._slidingGesture.closeOpened();
|
||||
|
Reference in New Issue
Block a user