created _upperCase util method for function and event name generation, and did some refactoring

This commit is contained in:
Eric Rowell
2013-03-21 20:24:03 -07:00
parent 9db24812bd
commit 0dbda82886
4 changed files with 34 additions and 20 deletions

View File

@@ -46,7 +46,7 @@ Test.Modules.DD = {
// which can't be simulated. call _endDrag manually
Kinetic.DD._endDrag();
},
'test dragstart, dragmove, dragend': function(containerId) {
'*test dragstart, dragmove, dragend': function(containerId) {
var stage = new Kinetic.Stage({
container: containerId,
width: 578,
@@ -74,14 +74,21 @@ Test.Modules.DD = {
var dragMove = false;
var dragEnd = false;
var mouseup = false;
var layerDragMove = false;
circle.on('dragstart', function() {
dragStart = true;
});
/*
circle.on('dragmove', function() {
dragMove = true;
});
*/
layer.on('dragmove', function() {
console.log('move');
});
circle.on('dragend', function() {
dragEnd = true;
@@ -90,7 +97,7 @@ Test.Modules.DD = {
});
circle.on('mouseup', function() {
console.log('mousup')
//console.log('mousup')
});
warn(layer.toDataURL() === dataUrls['drag circle before'], 'start data url is incorrect');
/*
@@ -103,7 +110,7 @@ Test.Modules.DD = {
});
//console.log(2)
test(!dragStart, 'dragstart event should not have been triggered');
test(!dragMove, 'dragmove event should not have been triggered');
//test(!dragMove, 'dragmove event should not have been triggered');
test(!dragEnd, 'dragend event should not have been triggered');
stage._mousemove({
@@ -112,7 +119,7 @@ Test.Modules.DD = {
});
test(dragStart, 'dragstart event was not triggered');
test(dragMove, 'dragmove event was not triggered');
//test(dragMove, 'dragmove event was not triggered');
test(!dragEnd, 'dragend event should not have been triggered');
stage._mouseup({
@@ -124,9 +131,8 @@ Test.Modules.DD = {
Kinetic.DD._endDrag();
test(dragStart, 'dragstart event was not triggered');
test(dragMove, 'dragmove event was not triggered');
//test(dragMove, 'dragmove event was not triggered');
test(dragEnd, 'dragend event was not triggered');
//test(!circle.getDraggable(), 'circle should no longer be draggable');
warn(layer.toDataURL() === dataUrls['drag circle after'], 'end data url is incorrect');
},