Changeset 598
- Timestamp:
- 2007-07-31 09:24:09 (16 months ago)
- Location:
- FCKeditor/trunk/editor/_source/internals
- Files:
-
- 2 modified
-
fck_gecko.js (modified) (5 diffs)
-
fcktools.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/editor/_source/internals/fck_gecko.js
r597 r598 70 70 if ( keyCode < 33 || keyCode > 40 ) 71 71 return ; 72 73 var blockEmptyStop = function( node ) 74 { 75 if ( node.nodeType != 1 ) 76 return false ; 77 var tag = node.tagName.toLowerCase() ; 78 return ( FCKListsLib.BlockElements[tag] || FCKListsLib.EmptyElements[tag] ) ; 79 } 72 80 73 81 var moveCursor = function() … … 79 87 80 88 var node = range.endContainer ; 81 89 82 90 // only perform the patched behavior if we're at the end of a text node. 83 91 if ( node.nodeType != 3 ) … … 96 104 // - if the DFS has scanned all nodes under my parent, then go the next step. 97 105 // - if there is a text node after me but still under my parent, then do nothing and return. 98 var nextTextNode = FCKTools.GetNextTextNode( node, node.parentNode ) ;106 var nextTextNode = FCKTools.GetNextTextNode( node, node.parentNode, blockEmptyStop ) ; 99 107 if ( nextTextNode ) 100 108 return ; … … 103 111 range = FCK.EditorDocument.createRange() ; 104 112 105 nextTextNode = FCKTools.GetNextTextNode( node, node.parentNode.parentNode ) ;113 nextTextNode = FCKTools.GetNextTextNode( node, node.parentNode.parentNode, blockEmptyStop ) ; 106 114 if ( nextTextNode ) 107 115 { … … 115 123 { 116 124 // no suitable next siblings under our grandparent! what to do next? 117 node = node.parentNode ; 125 while ( node.parentNode 126 && node == node.parentNode.lastChild 127 && ( ! FCKListsLib.BlockElements[node.parentNode.tagName.toLowerCase()] ) ) 128 node = node.parentNode ; 129 130 118 131 if ( FCKListsLib.BlockElements[ parentTag ] 119 132 || FCKListsLib.EmptyElements[ parentTag ] -
FCKeditor/trunk/editor/_source/internals/fcktools.js
r596 r598 535 535 } 536 536 537 FCKTools.GetNextTextNode = function( textnode, limitNode )537 FCKTools.GetNextTextNode = function( textnode, limitNode, checkStop ) 538 538 { 539 539 node = this.GetNextNode( textnode, limitNode ) ; 540 if ( checkStop && node && checkStop( node ) ) 541 return null ; 540 542 while ( node && node.nodeType != 3 ) 543 { 541 544 node = this.GetNextNode( node, limitNode ) ; 545 if ( checkStop && node && checkStop( node ) ) 546 return null ; 547 } 542 548 return node ; 543 549 }