MDL-34209 JavaScript: Tidy up dragdrop code.