/*\r
-Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.\r
+Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
For licensing, see LICENSE.html or http://ckeditor.com/license\r
*/\r
\r
var selection = this.editor.getSelection(),\r
element = selection && selection.getStartElement();\r
\r
- // Lock the selection in IE, so it can be restored when closing the\r
- // menu.\r
- if ( CKEDITOR.env.ie )\r
- selection.lock();\r
-\r
menu.onHide = CKEDITOR.tools.bind( function()\r
{\r
menu.onHide = null;\r
\r
if ( CKEDITOR.env.ie )\r
- editor.getSelection().unlock();\r
+ {\r
+ var selection = editor.getSelection();\r
+ selection && selection.unlock();\r
+ }\r
\r
this.onHide && this.onHide();\r
},\r
( CKEDITOR.env.webkit ? holdCtrlKey : domEvent.$.ctrlKey || domEvent.$.metaKey ) )\r
return;\r
\r
+ // Selection will be unavailable after context menu shows up\r
+ // in IE, lock it now.\r
+ if ( CKEDITOR.env.ie )\r
+ {\r
+ var selection = this.editor.getSelection();\r
+ selection && selection.lock();\r
+ }\r
+\r
// Cancel the browser context menu.\r
domEvent.preventDefault();\r
\r