Closed hrosenbauer closed 10 years ago
I would like to see this merged. :+1:
I'd also like to be able to pass in a function to determine the drag handle and resize handle.
This was fixed by allowing a custom ignore_dragging function. Example:
ignore_dragging: function (event) {
var $handle = $(event.target);
// ignore special elements
if ($handle.is('INPUT, TEXTAREA, SELECT, BUTTON')) {
return true;
}
// ignore all elements that are inside the .handle element
// (which is in my case the drag-handle)
return !$handle.closest('.handle').length;
}
(this is a updated version of my old pull-request at https://github.com/ducksboard/gridster.js/pull/326) Function ignore_drag checks if event.target is a descendant of or the handle itself. This allows the handle to have child elements and dragging still works. See http://jsbin.com/fuwunuyi/2 for a demo scenario: I added a span inside the header and now the widgets can't be dragged.