mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Merge branch 'master' into css-refactor
This commit is contained in:
@@ -30,7 +30,9 @@ export class ItemSlidingGesture extends DragGesture {
|
||||
};
|
||||
|
||||
this.mouseOut = (ev) => {
|
||||
this.onDragEnd(ev);
|
||||
if (ev.target.tagName === 'ION-ITEM-SLIDING') {
|
||||
this.onDragEnd(ev);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -54,10 +56,6 @@ export class ItemSlidingGesture extends DragGesture {
|
||||
this.set(itemContainerEle, 'offsetX', openAmout);
|
||||
this.set(itemContainerEle, 'startX', ev.center[this.direction]);
|
||||
|
||||
if (ev.srcEvent.type.indexOf('mouse') > -1) {
|
||||
ev.target.addEventListener('mouseout', this.mouseOut);
|
||||
}
|
||||
|
||||
this.dragEnded = false;
|
||||
}
|
||||
|
||||
@@ -87,6 +85,11 @@ export class ItemSlidingGesture extends DragGesture {
|
||||
newX = -Math.min(-itemData.optsWidth, -itemData.optsWidth + (((delta + itemData.optsWidth) * 0.4)));
|
||||
}
|
||||
|
||||
if (newX > 5 && ev.srcEvent.type.indexOf('mouse') > -1 && !itemData.hasMouseOut) {
|
||||
itemContainerEle.addEventListener('mouseout', this.mouseOut);
|
||||
itemData.hasMouseOut = true;
|
||||
}
|
||||
|
||||
raf(() => {
|
||||
if (!this.dragEnded && !this.preventDrag) {
|
||||
isItemActive(itemContainerEle, true);
|
||||
@@ -119,7 +122,8 @@ export class ItemSlidingGesture extends DragGesture {
|
||||
}
|
||||
}
|
||||
|
||||
ev.target.removeEventListener('mouseout', this.mouseOut);
|
||||
itemContainerEle.removeEventListener('mouseout', this.mouseOut);
|
||||
itemData.hasMouseOut = false;
|
||||
|
||||
raf(() => {
|
||||
this.open(itemContainerEle, restingPoint, true);
|
||||
|
||||
Reference in New Issue
Block a user