Comparing version 1.0.3 to 1.1.0
@@ -7,2 +7,7 @@ # Change Log | ||
## [1.1.0][2016-08-21] | ||
## Added | ||
- new property of `Konva.Shape` - `preventDefault`. | ||
## [1.0.3][2016-08-14] | ||
@@ -9,0 +14,0 @@ |
{ | ||
"name": "konva", | ||
"version": "1.0.3", | ||
"version": "1.1.0", | ||
"author": "Anton Lavrenov", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -23,3 +23,3 @@ ![Konva logo](https://raw.githubusercontent.com/konvajs/konvajs.github.io/master/apple-touch-icon-180x180.png) | ||
```html | ||
<script src="https://cdn.rawgit.com/konvajs/konva/1.0.3/konva.min.js"></script> | ||
<script src="https://cdn.rawgit.com/konvajs/konva/1.1.0/konva.min.js"></script> | ||
<div id="container"></div> | ||
@@ -69,6 +69,6 @@ <script> | ||
```html | ||
<script src="https://cdn.rawgit.com/konvajs/konva/1.0.3/konva.min.js"></script> | ||
<script src="https://cdn.rawgit.com/konvajs/konva/1.1.0/konva.min.js"></script> | ||
``` | ||
You can use CDN: [https://cdn.rawgit.com/konvajs/konva/1.0.3/konva.min.js](https://cdn.rawgit.com/konvajs/konva/1.0.3/konva.min.js) | ||
You can use CDN: [https://cdn.rawgit.com/konvajs/konva/1.1.0/konva.min.js](https://cdn.rawgit.com/konvajs/konva/1.1.0/konva.min.js) | ||
@@ -75,0 +75,0 @@ ###2 Load via AMD (requirejs): |
@@ -469,2 +469,24 @@ (function(Konva) { | ||
/** | ||
* get/set preventDefault | ||
* By default all shapes will prevent default behaviour | ||
* of a browser on a pointer move or tap. | ||
* that will prevent native scrolling when you are trying to drag&drop a shape | ||
* but sometimes you may need to enable default actions | ||
* in that case you can set the property to false | ||
* @name preventDefault | ||
* @method | ||
* @memberof Konva.Shape.prototype | ||
* @param {Number} preventDefault | ||
* @returns {Number} | ||
* @example | ||
* // get stroke width | ||
* var strokeWidth = shape.strokeWidth(); | ||
* | ||
* // set stroke width | ||
* shape.strokeWidth(); | ||
*/ | ||
Konva.Factory.addGetterSetter(Konva.Shape, 'preventDefault', true); | ||
/** | ||
* get/set stroke width | ||
@@ -471,0 +493,0 @@ * @name strokeWidth |
@@ -567,3 +567,3 @@ (function() { | ||
// only call preventDefault if the shape is listening for events | ||
if (shape.isListening() && evt.preventDefault) { | ||
if (shape.isListening() && shape.preventDefault() && evt.preventDefault) { | ||
evt.preventDefault(); | ||
@@ -604,3 +604,3 @@ } | ||
// only call preventDefault if the shape is listening for events | ||
if (shape.isListening() && evt.preventDefault) { | ||
if (shape.isListening() && shape.preventDefault() && evt.preventDefault) { | ||
evt.preventDefault(); | ||
@@ -629,3 +629,3 @@ } | ||
// only call preventDefault if the shape is listening for events | ||
if (shape.isListening() && evt.preventDefault) { | ||
if (shape.isListening() && shape.preventDefault() && evt.preventDefault) { | ||
evt.preventDefault(); | ||
@@ -637,3 +637,3 @@ } | ||
if(dd) { | ||
if (Konva.isDragging()) { | ||
if (Konva.isDragging() && Konva.DD.node.preventDefault()) { | ||
evt.preventDefault(); | ||
@@ -640,0 +640,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1245649
30169