Fix for error when going from edit mode to create a new graph.  This required moving the enableDragDrop function higher up in the code.