Fixed event triggering with data
This commit is contained in:
@@ -17,7 +17,7 @@ var DragHandle = function (handler) {
|
|||||||
mouseUp: function () {
|
mouseUp: function () {
|
||||||
|
|
||||||
if (!_moved && _currentAxis) {
|
if (!_moved && _currentAxis) {
|
||||||
$(document).trigger('PIE:dragbar-click', _currentAxis);
|
$(document).trigger('PIE:dragbar-click', { axis: _currentAxis });
|
||||||
}
|
}
|
||||||
|
|
||||||
_dragging = false;
|
_dragging = false;
|
||||||
|
|||||||
+8
-8
@@ -70,14 +70,14 @@
|
|||||||
$input.mirror.on('change', Event.Mirror);
|
$input.mirror.on('change', Event.Mirror);
|
||||||
$input.noCrop.on('change', Event.NoCrop);
|
$input.noCrop.on('change', Event.NoCrop);
|
||||||
$input.border.on('change', Event.SetBorder);
|
$input.border.on('change', Event.SetBorder);
|
||||||
$document.on('PIE:dragged', function() {
|
$document
|
||||||
|
.on('PIE:dragged', function() {
|
||||||
console.log('Dragged the image/dragbar!');
|
console.log('Dragged the image/dragbar!');
|
||||||
});
|
})
|
||||||
$document.on('PIE:needs-dragging', function() {
|
.on('PIE:needs-dragging', function(e, data) {
|
||||||
console.log('Image needs dragging!');
|
console.log('Image needs dragging on: ' + data.axis);
|
||||||
});
|
})
|
||||||
$document.on('PIE:dragbar-click', function(e, axis) {
|
.on('PIE:dragbar-click', function(e, data) {
|
||||||
|
console.log('Clicked on a dragbar! Axis: ' + data.axis);
|
||||||
console.log('Clicked on a dragbar! Axis: ' + axis);
|
|
||||||
});
|
});
|
||||||
}());
|
}());
|
||||||
|
|||||||
Reference in New Issue
Block a user