mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
ome drag&drop fixes
This commit is contained in:
parent
1c863ae389
commit
e518e64935
@ -5,6 +5,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [new version][unreleased]
|
||||
|
||||
## [2.1.7][2018-07-03]
|
||||
|
||||
## Fixed
|
||||
|
||||
* Some drag&drop fixes
|
||||
|
||||
## [2.1.6][2018-06-16]
|
||||
|
||||
## Fixed
|
||||
|
28
konva.js
28
konva.js
@ -2,7 +2,7 @@
|
||||
* Konva JavaScript Framework v2.1.6
|
||||
* http://konvajs.github.io/
|
||||
* Licensed under the MIT
|
||||
* Date: Wed Jun 20 2018
|
||||
* Date: Tue Jul 03 2018
|
||||
*
|
||||
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
||||
* Modified work Copyright (C) 2014 - present by Anton Lavrenov (Konva)
|
||||
@ -2970,7 +2970,7 @@
|
||||
});
|
||||
},
|
||||
/**
|
||||
* remove self from parent, but don't destroy
|
||||
* remove self from parent, but don't destroy. You can reuse node later.
|
||||
* @method
|
||||
* @memberof Konva.Node.prototype
|
||||
* @returns {Konva.Node}
|
||||
@ -2997,7 +2997,7 @@
|
||||
return this;
|
||||
},
|
||||
/**
|
||||
* remove and destroy self
|
||||
* remove and destroy a node. Kill it forever! You should not reuse node after destroy().
|
||||
* @method
|
||||
* @memberof Konva.Node.prototype
|
||||
* @example
|
||||
@ -10632,9 +10632,12 @@
|
||||
|
||||
// always call preventDefault for desktop events because some browsers
|
||||
// try to drag and drop the canvas element
|
||||
if (evt.cancelable) {
|
||||
evt.preventDefault();
|
||||
}
|
||||
// TODO: if we preventDefault() it will cancel event detection outside of window
|
||||
// but we need it for better drag&drop
|
||||
// can we disable native drag&drop somehow differently?
|
||||
// if (evt.cancelable) {
|
||||
// evt.preventDefault();
|
||||
// }
|
||||
},
|
||||
_mouseup: function(evt) {
|
||||
// workaround for mobile IE to force touch event when unhandled pointer event elevates into a mouse event
|
||||
@ -13038,15 +13041,14 @@
|
||||
*/
|
||||
|
||||
if (Konva.isBrowser) {
|
||||
var html = Konva.document.documentElement;
|
||||
html.addEventListener('mouseup', Konva.DD._endDragBefore, true);
|
||||
html.addEventListener('touchend', Konva.DD._endDragBefore, true);
|
||||
window.addEventListener('mouseup', Konva.DD._endDragBefore, true);
|
||||
window.addEventListener('touchend', Konva.DD._endDragBefore, true);
|
||||
|
||||
html.addEventListener('mousemove', Konva.DD._drag);
|
||||
html.addEventListener('touchmove', Konva.DD._drag);
|
||||
window.addEventListener('mousemove', Konva.DD._drag);
|
||||
window.addEventListener('touchmove', Konva.DD._drag);
|
||||
|
||||
html.addEventListener('mouseup', Konva.DD._endDragAfter, false);
|
||||
html.addEventListener('touchend', Konva.DD._endDragAfter, false);
|
||||
window.addEventListener('mouseup', Konva.DD._endDragAfter, false);
|
||||
window.addEventListener('touchend', Konva.DD._endDragAfter, false);
|
||||
}
|
||||
})();
|
||||
|
||||
|
4
konva.min.js
vendored
4
konva.min.js
vendored
File diff suppressed because one or more lines are too long
@ -317,14 +317,13 @@
|
||||
*/
|
||||
|
||||
if (Konva.isBrowser) {
|
||||
var html = Konva.document.documentElement;
|
||||
html.addEventListener('mouseup', Konva.DD._endDragBefore, true);
|
||||
html.addEventListener('touchend', Konva.DD._endDragBefore, true);
|
||||
window.addEventListener('mouseup', Konva.DD._endDragBefore, true);
|
||||
window.addEventListener('touchend', Konva.DD._endDragBefore, true);
|
||||
|
||||
html.addEventListener('mousemove', Konva.DD._drag);
|
||||
html.addEventListener('touchmove', Konva.DD._drag);
|
||||
window.addEventListener('mousemove', Konva.DD._drag);
|
||||
window.addEventListener('touchmove', Konva.DD._drag);
|
||||
|
||||
html.addEventListener('mouseup', Konva.DD._endDragAfter, false);
|
||||
html.addEventListener('touchend', Konva.DD._endDragAfter, false);
|
||||
window.addEventListener('mouseup', Konva.DD._endDragAfter, false);
|
||||
window.addEventListener('touchend', Konva.DD._endDragAfter, false);
|
||||
}
|
||||
})();
|
||||
|
@ -597,7 +597,7 @@
|
||||
});
|
||||
},
|
||||
/**
|
||||
* remove self from parent, but don't destroy
|
||||
* remove self from parent, but don't destroy. You can reuse node later.
|
||||
* @method
|
||||
* @memberof Konva.Node.prototype
|
||||
* @returns {Konva.Node}
|
||||
@ -624,7 +624,7 @@
|
||||
return this;
|
||||
},
|
||||
/**
|
||||
* remove and destroy self
|
||||
* remove and destroy a node. Kill it forever! You should not reuse node after destroy().
|
||||
* @method
|
||||
* @memberof Konva.Node.prototype
|
||||
* @example
|
||||
|
@ -515,9 +515,12 @@
|
||||
|
||||
// always call preventDefault for desktop events because some browsers
|
||||
// try to drag and drop the canvas element
|
||||
if (evt.cancelable) {
|
||||
evt.preventDefault();
|
||||
}
|
||||
// TODO: if we preventDefault() it will cancel event detection outside of window
|
||||
// but we need it for better drag&drop
|
||||
// can we disable native drag&drop somehow differently?
|
||||
// if (evt.cancelable) {
|
||||
// evt.preventDefault();
|
||||
// }
|
||||
},
|
||||
_mouseup: function(evt) {
|
||||
// workaround for mobile IE to force touch event when unhandled pointer event elevates into a mouse event
|
||||
|
13
test/ifame.html
Normal file
13
test/ifame.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>KonvaJS Sandbox</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=1.0, minimum-scale=1.0, maximum-scale=1.0">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<iframe src="./sandbox.html"></iframe>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user