From efc452dbfbbbc4fa26cd3414ce5f0cb3fa507363 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Thu, 22 Jan 2009 14:53:46 -0800 Subject: [PATCH] Fix iframe blindUp() call so it doesn't break getSelection() within the iframe. --- static/js/Editor.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/static/js/Editor.js b/static/js/Editor.js index c742943..de7168e 100644 --- a/static/js/Editor.js +++ b/static/js/Editor.js @@ -1100,11 +1100,12 @@ Editor.prototype.shutdown = function( event ) { if ( !iframe ) return; + // overriding afterFinishInternal for the iframe prevents it from being set to "display: none", + // which would break subsequent getSelection() calls iframe.editor = null; - blindUp( iframe, options = { "duration": 0.25, afterFinish: function () { + blindUp( iframe, options = { "duration": 0.25, afterFinishInternal: function () { try { - if ( iframe ) - addElementClass( iframe, "invisible" ); + addElementClass( iframe, "invisible" ); } catch ( e ) { } } } ); }