From ede2fdbc56ad8424b794ff31f20b5e3d0b35fe18 Mon Sep 17 00:00:00 2001 From: Garry Yao Date: Mon, 26 Nov 2012 18:08:32 +0800 Subject: [PATCH] Fixed context menu not register to editor focus on second open. --- plugins/floatpanel/plugin.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/floatpanel/plugin.js b/plugins/floatpanel/plugin.js index e0ac910e8ae..53f09ace4c7 100644 --- a/plugins/floatpanel/plugin.js +++ b/plugins/floatpanel/plugin.js @@ -142,6 +142,8 @@ CKEDITOR.plugins.add( 'floatpanel', { var element = this.element, iframe = this._.iframe, + // Non IE prefer the event into a window object. + focused = CKEDITOR.env.ie ? iframe : new CKEDITOR.dom.window( iframe.$.contentWindow ), doc = element.getDocument(), positionedAncestor = this._.parentElement.getPositionedAncestor(), position = offsetParent.getDocumentPosition( doc ), @@ -175,10 +177,11 @@ CKEDITOR.plugins.add( 'floatpanel', { // To allow the context menu to decrease back their width element.getFirst().removeStyle( 'width' ); + // Report to focus manager. + this._.editor.focusManager.add( focused ); + // Configure the IFrame blur event. Do that only once. if ( !this._.blurSet ) { - // Non IE prefer the event into a window object. - var focused = CKEDITOR.env.ie ? iframe : new CKEDITOR.dom.window( iframe.$.contentWindow ); // With addEventListener compatible browsers, we must // useCapture when registering the focus/blur events to @@ -210,9 +213,6 @@ CKEDITOR.plugins.add( 'floatpanel', { CKEDITOR.event.useCapture = false; - // Report to focus manager. - this._.editor.focusManager.add( focused ); - this._.blurSet = 1; }