From 4d5360e649c4dac3a5f23a2a92e75f9d257c0111 Mon Sep 17 00:00:00 2001 From: scottdowne Date: Wed, 17 Apr 2013 11:33:48 -0400 Subject: [PATCH] [#3220b] setTimeout on closing editors to allow for blur events to finish. --- public/src/editor/base-editor.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/src/editor/base-editor.js b/public/src/editor/base-editor.js index 40bece51d..693b4f800 100644 --- a/public/src/editor/base-editor.js +++ b/public/src/editor/base-editor.js @@ -73,8 +73,12 @@ define( [ "core/eventmanager", "util/scrollbars", "ui/widget/tooltip", "ui/widge * Closes the editor */ extendObject.close = function() { - // Remove the editor's root element from the element to which it was attached - extendObject.rootElement.parentNode.removeChild( extendObject.rootElement ); + // Putthing this in a setTimeout to allow any blur events on elements to finish + // before removing these elements. + setTimeout( function() { + // Remove the editor's root element from the element to which it was attached + extendObject.rootElement.parentNode.removeChild( extendObject.rootElement ); + }, 0 ); // If a close event existed on the events object passed into the constructor, call it if ( events.close ) {