X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=_source%2Fplugins%2Fmenu%2Fplugin.js;h=6e6b98eb9723651ff738973ad71aa7520ef9dcc7;hb=a272c66d841421f8bf933c16535bdcde1c4649fc;hp=265604c15d6fd865239fdf18491e8c22a3cf4c9e;hpb=fb481ba0a7d298e3e7b9034fcb9f2afdc6e8e796;p=ckeditor.git diff --git a/_source/plugins/menu/plugin.js b/_source/plugins/menu/plugin.js index 265604c..6e6b98e 100644 --- a/_source/plugins/menu/plugin.js +++ b/_source/plugins/menu/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2012, 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,14 +175,17 @@ CKEDITOR.plugins.add( 'menu', onHide : function() { + 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( true ); } - - this.onHide && this.onHide(); }, showSubMenu : function( index ) @@ -259,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 );