mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
@@ -21,7 +21,7 @@ export class ItemSlidingGesture extends DragGesture {
|
||||
}
|
||||
|
||||
onTapCallback(ev: any) {
|
||||
if (isFromOptionButtons(ev.target)) {
|
||||
if (isFromOptionButtons(ev)) {
|
||||
return;
|
||||
}
|
||||
let didClose = this.closeOpened();
|
||||
@@ -117,6 +117,10 @@ function getContainer(ev: any): ItemSliding {
|
||||
return null;
|
||||
}
|
||||
|
||||
function isFromOptionButtons(ele: HTMLElement): boolean {
|
||||
return !!closest(ele, 'ion-item-options', true);
|
||||
function isFromOptionButtons(ev: any): boolean {
|
||||
let button = closest(ev.target, '.button', true);
|
||||
if (!button) {
|
||||
return false;
|
||||
}
|
||||
return !!closest(button, 'ion-item-options', true);
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ export class ItemSliding {
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
*/
|
||||
getSlidingPercent(): number {
|
||||
let openAmount = this._openAmount;
|
||||
if (openAmount > 0) {
|
||||
@@ -364,7 +364,7 @@ export class ItemSliding {
|
||||
this._timer = null;
|
||||
}
|
||||
this._openAmount = openAmount;
|
||||
|
||||
|
||||
if (isFinal) {
|
||||
this.item.setCssStyle(CSS.transition, '');
|
||||
|
||||
@@ -380,7 +380,7 @@ export class ItemSliding {
|
||||
let state = (openAmount <= (-this._optsWidthLeftSide - SWIPE_MARGIN))
|
||||
? SlidingState.Left | SlidingState.SwipeLeft
|
||||
: SlidingState.Left;
|
||||
|
||||
|
||||
this._setState(state);
|
||||
}
|
||||
}
|
||||
@@ -392,7 +392,7 @@ export class ItemSliding {
|
||||
this.item.setCssStyle(CSS.transform, '');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
this.item.setCssStyle(CSS.transform, `translate3d(${-openAmount}px,0,0)`);
|
||||
this.ionDrag.emit(this);
|
||||
}
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
</button>
|
||||
</ion-item-options>
|
||||
<ion-item-options side="right">
|
||||
<button danger (click)="share(item100)">
|
||||
<button danger (click)="unread(item100)">
|
||||
<ion-icon name="trash"></ion-icon>
|
||||
</button>
|
||||
<button (click)="favorite(item100)" >
|
||||
<button (click)="unread(item100)" >
|
||||
<ion-icon name="star"></ion-icon>
|
||||
</button>
|
||||
</ion-item-options>
|
||||
|
||||
Reference in New Issue
Block a user