docs()item-sliding and lists

This commit is contained in:
mhartington
2015-12-16 15:28:26 -05:00
parent 5ec73a6bf3
commit 3b035a0d23
2 changed files with 38 additions and 0 deletions

View File

@ -23,6 +23,8 @@ import {List} from '../list/list';
* </ion-item>
* </ion-list>
* ```
* @see {@link /docs/v2/components#lists List Component Docs}
* @see {@link ../../list/List List API Docs}
*/
@Component({
selector: 'ion-item-sliding',
@ -37,6 +39,9 @@ export class ItemSliding {
elementRef.nativeElement.$ionSlide = ++slideIds;
}
/**
* @private
*/
close() {
this.list.closeSlidingItems();
}

View File

@ -76,6 +76,22 @@ export class List extends Ion {
this.itemTemplate = item;
}
/**
* Enable sliding items if your page has them
*
* ```ts
* export class MyClass {
* constructor(app: IonicApp){
* this.app = app;
* this.list = this.app.getComponent('my-list');
* }
* stopSliding(){
* this.list.enableSlidingItems(false);
* }
* }
* ```
* @param {Boolean} shouldEnable whether the item-sliding should be enabled or not
*/
enableSlidingItems(shouldEnable) {
if (this._enableSliding !== shouldEnable) {
this._enableSliding = shouldEnable;
@ -94,6 +110,23 @@ export class List extends Ion {
}
}
/**
* Enable sliding items if your page has
*
* ```ts
* export class MyClass {
* constructor(app: IonicApp){
* this.app = app;
* this.list = this.app.getComponent('my-list');
* }
* // Here we have some method that will close the items
* // when called
* closeItmes(){
* this.list.closeSlidingItems();
* }
* }
* ```
*/
closeSlidingItems() {
this.slidingGesture && this.slidingGesture.closeOpened();
}