Ticket #3231: 3231_3.patch
File 3231_3.patch, 3.1 KB (added by , 15 years ago) |
---|
-
_source/plugins/selection/plugin.js
624 624 { 625 625 range.optimize(); 626 626 627 // Decrease the range content to exclude particial 628 // selected node on the start which doesn't have 629 // visual impact. ( #3231 ) 630 do 631 { 632 var startContainer = range.startContainer, 633 startOffset = range.startOffset; 634 if ( startOffset == ( startContainer.getChildCount ? 635 startContainer.getChildCount() : startContainer.getLength() ) ) 636 range.setStartAfter( startContainer ); 637 else break; 638 } 639 while( true ) 640 627 641 node = range.startContainer; 628 642 629 643 if ( node.type != CKEDITOR.NODE_ELEMENT ) -
_source/core/dom/node.js
221 221 }, 222 222 223 223 /** 224 * Gets a DOM tree descendant under the current node.225 * @param {Array|Number} indices The child index or array of child indices under the node.226 * @returns {CKEDITOR.dom.node} The specified DOM child under the current node. Null if child does not exist.227 * @example228 * var strong = p.getChild(0);229 */230 getChild : function( indices )231 {232 var rawNode = this.$;233 234 if ( !indices.slice )235 rawNode = rawNode.childNodes[ indices ];236 else237 {238 while ( indices.length > 0 && rawNode )239 rawNode = rawNode.childNodes[ indices.shift() ];240 }241 242 return rawNode ? new CKEDITOR.dom.node( rawNode ) : null;243 },244 245 getChildCount : function()246 {247 return this.$.childNodes.length;248 },249 250 /**251 224 * Gets the document containing this element. 252 225 * @returns {CKEDITOR.dom.document} The document. 253 226 * @example -
_source/core/dom/element.js
1311 1311 this.$.parentNode.replaceChild( newNode.$, this.$ ); 1312 1312 newNode.$._cke_expando = this.$._cke_expando; 1313 1313 this.$ = newNode.$; 1314 } 1314 }, 1315 1316 /** 1317 * Gets a DOM tree descendant under the current node. 1318 * @param {Array|Number} indices The child index or array of child indices under the node. 1319 * @returns {CKEDITOR.dom.node} The specified DOM child under the current node. Null if child does not exist. 1320 * @example 1321 * var strong = p.getChild(0); 1322 */ 1323 getChild : function( indices ) 1324 { 1325 var rawNode = this.$; 1326 1327 if ( !indices.slice ) 1328 rawNode = rawNode.childNodes[ indices ]; 1329 else 1330 { 1331 while ( indices.length > 0 && rawNode ) 1332 rawNode = rawNode.childNodes[ indices.shift() ]; 1333 } 1334 1335 return rawNode ? new CKEDITOR.dom.node( rawNode ) : null; 1336 }, 1337 1338 getChildCount : function() 1339 { 1340 return this.$.childNodes.length; 1341 }, 1342 1315 1343 });