/*\r
-Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
\r
onHide : function()\r
{\r
- if ( CKEDITOR.env.ie )\r
+ this._.unlockSelection();\r
+ this.onHide && this.onHide();\r
+ },\r
+\r
+ unlockSelection : function() {\r
+ // Unlock the selection upon first panel closing.\r
+ if ( CKEDITOR.env.ie && !this.parent )\r
{\r
var selection = this.editor.getSelection();\r
- selection && selection.unlock();\r
+ selection && selection.unlock( true );\r
}\r
-\r
- this.onHide && this.onHide();\r
},\r
\r
showSubMenu : function( index )\r
{\r
this._.onShow();\r
// Don't menu with zero items.\r
- if ( ! this.items.length )\r
+ if ( ! this.items.length ) {\r
+ this._.unlockSelection();\r
return;\r
+ }\r
}\r
\r
corner = corner || ( this.editor.lang.dir == 'rtl' ? 2 : 1 );\r