X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fselection%2Fplugin.js;h=a78bb36f8dc040eb180dab36e3fdfb3188cb66ec;hp=cf699ce83c89ef64137525a3c601d88301235702;hb=941b0a9ba4e673e292510d80a5a86806994b8ea6;hpb=7cd80714081a8ffdf4a1a8d2c72f120ed5ef3d6d diff --git a/_source/plugins/selection/plugin.js b/_source/plugins/selection/plugin.js index cf699ce..a78bb36 100644 --- a/_source/plugins/selection/plugin.js +++ b/_source/plugins/selection/plugin.js @@ -1,5 +1,5 @@ /* -Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved. +Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.html or http://ckeditor.com/license */ @@ -144,15 +144,8 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // inside a selection. We don't want to capture that. body.on( 'mousedown', disableSave ); body.on( 'mouseup', - function( evt ) + function() { - // IE context-menu event in table cells collapse - // whatever selection is, avoiding saving this - // 'wrong' snapshot.(#3001) - evt = evt.data; - if ( evt.$.button == 2 && evt.getTarget().hasAscendant( 'table' ) ) - return; - saveEnabled = true; setTimeout( function() { @@ -942,6 +935,14 @@ For licensing, see LICENSE.html or http://ckeditor.com/license return this; }, + getCommonAncestor : function() + { + var ranges = this.getRanges(), + startNode = ranges[ 0 ].startContainer, + endNode = ranges[ ranges.length - 1 ].endContainer; + return startNode.getCommonAncestor( endNode ); + }, + // Moving scroll bar to the current selection's start position. scrollIntoView : function() {