Created
July 4, 2014 00:12
-
-
Save leocaseiro/664fbb4ea4841467eb22 to your computer and use it in GitHub Desktop.
jQuery UI Sortable Remove Dragged Item out
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$( "#sortable" ).sortable({ | |
forcePlaceholderSize: true, | |
tolerance: 'pointer', | |
cursor: 'pointer', | |
over: function () { | |
removeIntent = false; | |
}, | |
out: function () { | |
removeIntent = true; | |
}, | |
beforeStop: function (event, ui) { | |
if(removeIntent === true) { | |
ui.item.hide(); | |
if (confirm('Are you sure want to remove this photo?')) { | |
ui.item.remove(); | |
} else { | |
ui.item.show(); | |
} | |
} | |
} | |
}); | |
$( "#sortable" ).disableSelection(); |
Awesome ! This way is helpful for me.
Thank you.
Thanks!!!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome ! This way is helpful for me.
Thank you.