Created
February 19, 2013 20:38
-
-
Save chadothompson/4989709 to your computer and use it in GitHub Desktop.
A Gist showing the use of "detatch" for JQuery UI drop events.
This file contains 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
jQuery(".case").droppable({ | |
hoverClass: "highlightNewcase", | |
drop: function (event, ui) { | |
// Don't submit if the ID is currently a child | |
var selectedDocumentId = jQuery(ui.draggable).attr('id').split('_')[1]; | |
var selectedCaseId = jQuery(this).attr('id').split('_')[1]; | |
var documentsParentCaseId = jQuery(ui.draggable.parent()).attr('id').split('_')[1]; | |
if (selectedCaseId != documentsParentCaseId) { | |
ui.draggable.detach(); | |
documentTabPost('CRFilingCaseDetail.do?action=ADD_DOCUMENT&selectedCaseId=' + selectedCaseId + '&selectedDocumentId=' + selectedDocumentId, null); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment