Fixed event triggering with data

This commit is contained in:
Erik Tiekstra
2017-05-17 15:43:17 +02:00
parent afa1b13201
commit ad195acb7b
2 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ var DragHandle = function (handler) {
mouseUp: function () {
if (!_moved && _currentAxis) {
$(document).trigger('PIE:dragbar-click', _currentAxis);
$(document).trigger('PIE:dragbar-click', { axis: _currentAxis });
}
_dragging = false;
+10 -10
View File
@@ -70,14 +70,14 @@
$input.mirror.on('change', Event.Mirror);
$input.noCrop.on('change', Event.NoCrop);
$input.border.on('change', Event.SetBorder);
$document.on('PIE:dragged', function() {
console.log('Dragged the image/dragbar!');
});
$document.on('PIE:needs-dragging', function() {
console.log('Image needs dragging!');
});
$document.on('PIE:dragbar-click', function(e, axis) {
console.log('Clicked on a dragbar! Axis: ' + axis);
});
$document
.on('PIE:dragged', function() {
console.log('Dragged the image/dragbar!');
})
.on('PIE:needs-dragging', function(e, data) {
console.log('Image needs dragging on: ' + data.axis);
})
.on('PIE:dragbar-click', function(e, data) {
console.log('Clicked on a dragbar! Axis: ' + data.axis);
});
}());