X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fmenu%2Fplugin.js;h=6e6b98eb9723651ff738973ad71aa7520ef9dcc7;hb=a272c66d841421f8bf933c16535bdcde1c4649fc;hp=0165d31041297c431818dc672e997019b615397a;hpb=f0610347140239143439a511ee2bd48cb784f470;p=ckeditor.git diff --git a/_source/plugins/menu/plugin.js b/_source/plugins/menu/plugin.js index 0165d31..6e6b98e 100644 --- a/_source/plugins/menu/plugin.js +++ b/_source/plugins/menu/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -175,13 +175,17 @@ CKEDITOR.plugins.add( 'menu', onHide : function() { - if ( CKEDITOR.env.ie ) + this._.unlockSelection(); + this.onHide && this.onHide(); + }, + + unlockSelection : function() { + // Unlock the selection upon first panel closing. + if ( CKEDITOR.env.ie && !this.parent ) { var selection = this.editor.getSelection(); - selection && selection.unlock(); + selection && selection.unlock( true ); } - - this.onHide && this.onHide(); }, showSubMenu : function( index ) @@ -258,8 +262,10 @@ CKEDITOR.plugins.add( 'menu', { this._.onShow(); // Don't menu with zero items. - if ( ! this.items.length ) + if ( ! this.items.length ) { + this._.unlockSelection(); return; + } } corner = corner || ( this.editor.lang.dir == 'rtl' ? 2 : 1 );