MDL-47368 core JS: dragdrop click move fills the dom with divs
authorTim Hunt <T.J.Hunt@open.ac.uk>
Mon, 27 Oct 2014 17:26:40 +0000 (17:26 +0000)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Tue, 28 Oct 2014 11:32:44 +0000 (11:32 +0000)
Every time you click the move icon, it builds a new dialogue with a list
of drop targets, but it never discards the old ones. Not only does this
fill the DOM with junk, but it also causes Behat tests to fail, since
the old dialogues come first, and are hidden, but contain links with the
same text that you are trying to click.

lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-debug.js
lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-min.js
lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop.js
lib/yui/src/dragdrop/js/dragdrop.js

index af66f37..d086ba0 100644 (file)
Binary files a/lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-debug.js and b/lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-debug.js differ
index 991fbbb..559fab6 100644 (file)
Binary files a/lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-min.js and b/lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop-min.js differ
index af66f37..d086ba0 100644 (file)
Binary files a/lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop.js and b/lib/yui/build/moodle-core-dragdrop/moodle-core-dragdrop.js differ
index 00a8e9f..ab52c5f 100644 (file)
@@ -559,6 +559,9 @@ Y.extend(DRAGDROP, Y.Base, {
             M.core.dragdrop.keydraghandle.focus();
             M.core.dragdrop.keydragcontainer = null;
         }
+        if (M.core.dragdrop.dropui) {
+            M.core.dragdrop.dropui.destroy();
+        }
     },
 
     /**