mirror of
https://github.com/konvajs/konva.git
synced 2025-10-14 20:04:52 +08:00
mousedown and touchstart events now always call preventDefault
This commit is contained in:
@@ -38,6 +38,13 @@
|
||||
this.element.style.background = 'transparent';
|
||||
this.context = this.element.getContext(contextType);
|
||||
this.setSize(width, height);
|
||||
|
||||
this.element.addEventListener('mousedown', function(evt) {
|
||||
evt.preventDefault();
|
||||
});
|
||||
this.element.addEventListener('touchstart', function(evt) {
|
||||
evt.preventDefault();
|
||||
});
|
||||
},
|
||||
/**
|
||||
* get canvas element
|
||||
|
@@ -22,5 +22,5 @@
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body onmousedown="return false;"></body>
|
||||
<body></body>
|
||||
</html>
|
||||
|
@@ -27,6 +27,26 @@ Test.Modules.RECT = {
|
||||
|
||||
test(rect.getClassName() === 'Rect', 'className should be Rect');
|
||||
},
|
||||
'add fill stroke rect': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
container: containerId,
|
||||
width: 578,
|
||||
height: 200
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
var rect = new Kinetic.Rect({
|
||||
x: 200,
|
||||
y: 100,
|
||||
width: 100,
|
||||
height: 50,
|
||||
fill: 'blue',
|
||||
stroke: 'green',
|
||||
strokeWidth: 4
|
||||
});
|
||||
|
||||
layer.add(rect);
|
||||
stage.add(layer);
|
||||
},
|
||||
'add stroke rect': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
container: containerId,
|
||||
|
Reference in New Issue
Block a user