mousedown and touchstart events now always call preventDefault

This commit is contained in:
Eric Rowell
2013-05-31 23:04:07 -07:00
parent 3cfd49a03e
commit 324d841ed4
3 changed files with 28 additions and 1 deletions

View File

@@ -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

View File

@@ -22,5 +22,5 @@
};
</script>
</head>
<body onmousedown="return false;"></body>
<body></body>
</html>

View File

@@ -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,