# HG changeset patch # User Franck Deroche # Date 1271673302 0 # Node ID f817d2a5cc0a4dc7e7de37c173ca9854bf8cc19f # Parent cbfe386cb51ba21f022089e80a033accd94f4329 DnD: Fix a JS error that occured when disabling the RTE diff -r cbfe386cb51b -r f817d2a5cc0a js/jquery.draganddrop.js --- a/js/jquery.draganddrop.js Mon Feb 15 14:08:04 2010 +0000 +++ b/js/jquery.draganddrop.js Mon Apr 19 10:35:02 2010 +0000 @@ -128,6 +128,11 @@ $(targets).filter('iframe').each(function() { var target = this; var t = setInterval(function() { + var ifr = $(target)[0]; + // Check that jQuery .contents() can work, and return early otherwise. + if (!ifr.contentDocument && !ifr.contentWindow) { + return; + } $('img:not(.'+ opt.droppedClass +')', $(target).contents()).each(function() { opt.processIframeDrop.call(target, this, opt.idSelector); var data = {'drop': this, 'representation_id': opt.idSelector(this)};