Fixed event triggering with data
This commit is contained in:
@@ -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
@@ -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);
|
||||
});
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user