docs(list): clean up docs and hide gestureCtrl

This commit is contained in:
mhartington
2016-07-29 11:27:09 -05:00
parent 1c596556c5
commit 4e26ea3294
2 changed files with 23 additions and 37 deletions

View File

@ -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,
})
});

View File

@ -20,31 +20,8 @@ import { GestureController } from '../../gestures/gesture-controller';
*
* @demo /docs/v2/demos/list/
* @see {@link /docs/v2/components#lists List Component Docs}
* @advanced
*
*/
@Directive({
selector: 'ion-list',
})
export class List extends Ion {
private _enableSliding: boolean = true;
private _containsSlidingItems: boolean = false;
private _slidingGesture: ItemSlidingGesture;
constructor(
elementRef: ElementRef,
private _rendered: Renderer,
public gestureCtrl: GestureController) {
super(elementRef);
}
/**
* @private
*/
ngOnDestroy() {
this._slidingGesture && this._slidingGesture.destroy();
}
/**
* Enable the sliding items.
*
* ```ts
@ -62,7 +39,32 @@ export class List extends Ion {
* }
* }
* ```
* @param {boolean} shouldEnable whether the item-sliding should be enabled or not
*
*/
@Directive({
selector: 'ion-list',
})
export class List extends Ion {
private _enableSliding: boolean = true;
private _containsSlidingItems: boolean = false;
private _slidingGesture: ItemSlidingGesture;
constructor(
elementRef: ElementRef,
private _rendered: Renderer,
public _gestureCtrl: GestureController) {
super(elementRef);
}
/**
* @private
*/
ngOnDestroy() {
this._slidingGesture && this._slidingGesture.destroy();
}
/**
* @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();