update CHANGELOG with new version

This commit is contained in:
Anton Lavrenov
2020-06-30 13:04:06 -05:00
parent 035ab99cb4
commit bdfa9f2225
4 changed files with 24 additions and 12 deletions

View File

@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/). This project adheres to [Semantic Versioning](http://semver.org/).
## 7.0.2 - 2020-06-30
* Fix wrong trigger `dbltap` and `click` on mobile
## 7.0.1 - 2020-06-29 ## 7.0.1 - 2020-06-29
* Fixes for different font families support. * Fixes for different font families support.

View File

@@ -8,7 +8,7 @@
* Konva JavaScript Framework v7.0.1 * Konva JavaScript Framework v7.0.1
* http://konvajs.org/ * http://konvajs.org/
* Licensed under the MIT * Licensed under the MIT
* Date: Mon Jun 29 2020 * Date: Tue Jun 30 2020
* *
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS) * Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva) * Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
@@ -6422,7 +6422,7 @@
Stage.prototype._touchend = function (evt) { Stage.prototype._touchend = function (evt) {
var _this = this; var _this = this;
this.setPointersPositions(evt); this.setPointersPositions(evt);
var clickEndShape = this.clickEndShape, fireDblClick = false; var tapEndShape = this.tapEndShape, fireDblClick = false;
if (Konva.inDblClickWindow) { if (Konva.inDblClickWindow) {
fireDblClick = true; fireDblClick = true;
clearTimeout(this.dblTimeout); clearTimeout(this.dblTimeout);
@@ -6453,14 +6453,14 @@
return; return;
} }
processedShapesIds[shape._id] = true; processedShapesIds[shape._id] = true;
_this.clickEndShape = shape; _this.tapEndShape = shape;
shape._fireAndBubble(TOUCHEND, { evt: evt, pointerId: pos.id }); shape._fireAndBubble(TOUCHEND, { evt: evt, pointerId: pos.id });
triggeredOnShape = true; triggeredOnShape = true;
// detect if tap or double tap occurred // detect if tap or double tap occurred
if (Konva.listenClickTap && shape === _this.tapStartShape) { if (Konva.listenClickTap && shape === _this.tapStartShape) {
tapTriggered = true; tapTriggered = true;
shape._fireAndBubble(TAP, { evt: evt, pointerId: pos.id }); shape._fireAndBubble(TAP, { evt: evt, pointerId: pos.id });
if (fireDblClick && clickEndShape && clickEndShape === shape) { if (fireDblClick && tapEndShape && tapEndShape === shape) {
dblTapTriggered = true; dblTapTriggered = true;
shape._fireAndBubble(DBL_TAP, { evt: evt, pointerId: pos.id }); shape._fireAndBubble(DBL_TAP, { evt: evt, pointerId: pos.id });
} }
@@ -6479,7 +6479,7 @@
}); });
} }
if (Konva.listenClickTap && !tapTriggered) { if (Konva.listenClickTap && !tapTriggered) {
this.clickEndShape = null; this.tapEndShape = null;
this._fire(TAP, { this._fire(TAP, {
evt: evt, evt: evt,
target: this, target: this,
@@ -6503,6 +6503,9 @@
this._fire(CONTENT_DBL_TAP, { evt: evt }); this._fire(CONTENT_DBL_TAP, { evt: evt });
} }
} }
if (this.preventDefault() && evt.cancelable) {
evt.preventDefault();
}
Konva.listenClickTap = false; Konva.listenClickTap = false;
}; };
Stage.prototype._wheel = function (evt) { Stage.prototype._wheel = function (evt) {

4
konva.min.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -135,8 +135,9 @@ export class Stage extends Container<Layer> {
targetShape: Shape; targetShape: Shape;
clickStartShape: Shape; clickStartShape: Shape;
clickEndShape: Shape; clickEndShape: Shape;
dblTimeout: any;
tapStartShape: Shape; tapStartShape: Shape;
tapEndShape: Shape;
dblTimeout: any;
constructor(config: StageConfig) { constructor(config: StageConfig) {
super(checkNoClip(config)); super(checkNoClip(config));
@@ -747,7 +748,7 @@ export class Stage extends Container<Layer> {
_touchend(evt) { _touchend(evt) {
this.setPointersPositions(evt); this.setPointersPositions(evt);
var clickEndShape = this.clickEndShape, var tapEndShape = this.tapEndShape,
fireDblClick = false; fireDblClick = false;
if (Konva.inDblClickWindow) { if (Konva.inDblClickWindow) {
@@ -786,7 +787,7 @@ export class Stage extends Container<Layer> {
} }
processedShapesIds[shape._id] = true; processedShapesIds[shape._id] = true;
this.clickEndShape = shape; this.tapEndShape = shape;
shape._fireAndBubble(TOUCHEND, { evt: evt, pointerId: pos.id }); shape._fireAndBubble(TOUCHEND, { evt: evt, pointerId: pos.id });
triggeredOnShape = true; triggeredOnShape = true;
@@ -795,7 +796,7 @@ export class Stage extends Container<Layer> {
tapTriggered = true; tapTriggered = true;
shape._fireAndBubble(TAP, { evt: evt, pointerId: pos.id }); shape._fireAndBubble(TAP, { evt: evt, pointerId: pos.id });
if (fireDblClick && clickEndShape && clickEndShape === shape) { if (fireDblClick && tapEndShape && tapEndShape === shape) {
dblTapTriggered = true; dblTapTriggered = true;
shape._fireAndBubble(DBL_TAP, { evt: evt, pointerId: pos.id }); shape._fireAndBubble(DBL_TAP, { evt: evt, pointerId: pos.id });
} }
@@ -817,7 +818,7 @@ export class Stage extends Container<Layer> {
} }
if (Konva.listenClickTap && !tapTriggered) { if (Konva.listenClickTap && !tapTriggered) {
this.clickEndShape = null; this.tapEndShape = null;
this._fire(TAP, { this._fire(TAP, {
evt: evt, evt: evt,
target: this, target: this,
@@ -842,6 +843,10 @@ export class Stage extends Container<Layer> {
} }
} }
if (this.preventDefault() && evt.cancelable) {
evt.preventDefault();
}
Konva.listenClickTap = false; Konva.listenClickTap = false;
} }