e6f0b39740cddadf24a8e524feadeef791ede8d0 braney Thu Feb 8 17:00:15 2018 -0800 don't let people drop collections into other collections diff --git src/hg/js/hgCollection.js src/hg/js/hgCollection.js index 6edd4ad..493bfa6 100644 --- src/hg/js/hgCollection.js +++ src/hg/js/hgCollection.js @@ -138,31 +138,31 @@ selectedTree = tree; $(selectedTree).jstree("open_node", selectedNode); } function doubleClickTreeNode(evt, data) { doubleClickNode(evt.target); } function selectTreeNode(evt, data) { selectNode(evt.target, data.node); } function checkCallback( operation, node, node_parent, node_position, more) { // called during a drag and drop action to see if the target is droppable if ((operation === "copy_node") || (operation === "move_node")) { - if (node_parent.parent === '#') + if ((node.parent != '#') && (node_parent.parent === '#')) return true; return false; } return true; } function dialogCollection() { $("#doNewCollection").off ( "click" ); $("#doNewCollection").click ( newCollection ); $("#viewFuncDiv").show(); $("#customName").val("New Collection"); $("#customDescription").val("New Collection description"); $("#customVis").val("full"); $("#customColorInput").val("#0"); $("#viewFunc").val("show all");