I am using gridster gridster.net for some draggable items. Those items are also clickable. When there is a click, it expands. But problem is that when I drag an item, it also fire a click event and the item expands after dropping. How can I prevent that?
Here is my jquery code example:
$(document).on('click touchend', '.gridster li.gs-closed p', function() {
var clickedItem = $(this);
var parent = clickedItem.parent('li');
gridster.resize_widget(parent, 1,4);
parent.removeClass('gs-closed').addClass('gs-opened');
});
$(document).on('dblclick touchend', '.gridster li.gs-opened p', function() {
var clickedItem = $(this);
var parent = clickedItem.parent('li');
gridster.resize_widget(parent, 1, 1);
parent.removeClass('gs-opened').addClass('gs-closed');
});