JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.1
[ckeditor.git] / _source / plugins / selection / plugin.js
index cf699ce..a78bb36 100644 (file)
@@ -1,5 +1,5 @@
 /*\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
@@ -144,15 +144,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                                                // inside a selection. We don't want to capture that.\r
                                                body.on( 'mousedown', disableSave );\r
                                                body.on( 'mouseup',\r
-                                                       function( evt )\r
+                                                       function()\r
                                                        {\r
-                                                               // IE context-menu event in table cells collapse\r
-                                                               // whatever selection is, avoiding saving this\r
-                                                               // 'wrong' snapshot.(#3001)\r
-                                                               evt = evt.data;\r
-                                                               if ( evt.$.button == 2 && evt.getTarget().hasAscendant( 'table' ) )\r
-                                                                       return;\r
-\r
                                                                saveEnabled = true;\r
                                                                setTimeout( function()\r
                                                                        {\r
@@ -942,6 +935,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license
                        return this;\r
                },\r
 \r
+               getCommonAncestor : function()\r
+               {\r
+                       var ranges = this.getRanges(),\r
+                               startNode = ranges[ 0 ].startContainer,\r
+                               endNode = ranges[ ranges.length - 1 ].endContainer;\r
+                       return startNode.getCommonAncestor( endNode );\r
+               },\r
+\r
                // Moving scroll bar to the current selection's start position.\r
                scrollIntoView : function()\r
                {\r