mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(itemSliding): enableSlidingItems
This commit is contained in:
@ -77,22 +77,19 @@ export class List extends Ion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enableSlidingItems(shouldEnable) {
|
enableSlidingItems(shouldEnable) {
|
||||||
if (this._init) {
|
if (this._enableSliding !== shouldEnable) {
|
||||||
|
this._enableSliding = shouldEnable;
|
||||||
|
|
||||||
if (this._enableSliding !== shouldEnable) {
|
if (shouldEnable) {
|
||||||
this._enableSliding = shouldEnable;
|
console.debug('enableSlidingItems');
|
||||||
|
this.zone.runOutsideAngular(() => {
|
||||||
if (shouldEnable) {
|
setTimeout(() => {
|
||||||
console.debug('enableSlidingItems');
|
this.slidingGesture = new ItemSlidingGesture(this, this.ele);
|
||||||
this.zone.runOutsideAngular(() => {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.slidingGesture = new ItemSlidingGesture(this, this.ele);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.slidingGesture && this.slidingGesture.unlisten();
|
this.slidingGesture && this.slidingGesture.unlisten();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -101,15 +98,6 @@ export class List extends Ion {
|
|||||||
this.slidingGesture && this.slidingGesture.closeOpened();
|
this.slidingGesture && this.slidingGesture.closeOpened();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
ngAfterViewInit() {
|
|
||||||
this._init = true;
|
|
||||||
if (this._enableSliding) {
|
|
||||||
this.enableSlidingItems(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user