Changeset 1124
- Timestamp:
- 2007-11-27 15:12:00 (2 years ago)
- Location:
- FCKeditor/trunk
- Files:
-
- 4 modified
-
editor/dialog/fck_replace.html (modified) (1 diff)
-
editor/_source/classes/fckenterkey.js (modified) (2 diffs)
-
editor/_source/internals/fckdomtools.js (modified) (3 diffs)
-
_whatsnew.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
FCKeditor/trunk/editor/dialog/fck_replace.html
r1108 r1124 351 351 while ( focus && focus.nodeType != 1 ) 352 352 focus = focus.parentNode ; 353 353 354 if ( focus ) 354 focus.scrollIntoView( false ) ; 355 { 356 if ( oEditor.FCKBrowserInfo.IsSafari ) 357 oEditor.FCKDomTools.ScrollIntoView( focus, false ) ; 358 else 359 focus.scrollIntoView( false ) ; 360 } 361 355 362 return true; 356 363 } -
FCKeditor/trunk/editor/_source/classes/fckenterkey.js
r1083 r1124 493 493 oRange.MoveToElementEditStart( bIsStartOfBlock && !bIsEndOfBlock ? eNextBlock : eNewBlock ) ; 494 494 495 if ( FCKBrowserInfo.IsGeckoLike ) 495 if ( FCKBrowserInfo.IsSafari ) 496 FCKDomTools.ScrollIntoView( eNewBlock, false ) ; 497 else if ( FCKBrowserInfo.IsGeckoLike ) 496 498 eNewBlock.scrollIntoView( false ) ; 497 499 } … … 575 577 else 576 578 dummy = this.Window.document.createElement( 'br' ) ; 579 577 580 eLineBreak.parentNode.insertBefore( dummy, eLineBreak.nextSibling ) ; 578 dummy.scrollIntoView( false ) ; 581 582 if ( FCKBrowserInfo.IsSafari ) 583 FCKDomTools.ScrollIntoView( dummy, false ) ; 584 else 585 dummy.scrollIntoView( false ) ; 586 579 587 dummy.parentNode.removeChild( dummy ) ; 580 588 } -
FCKeditor/trunk/editor/_source/internals/fckdomtools.js
r1089 r1124 254 254 if ( ignoreElements && currentNode.nodeName.IEquals( ignoreElements ) ) 255 255 return this.GetNextSourceElement( currentNode, ignoreSpaceTextOnly, stopSearchElements, ignoreElements ) ; 256 256 257 257 return currentNode ; 258 258 } … … 315 315 return this.GetPreviousSourceNode( currentNode.parentNode, true, nodeType, stopSearchNode ) ; 316 316 } 317 317 318 318 if ( nodeType && node && node.nodeType != nodeType ) 319 319 return this.GetPreviousSourceNode( node, false, nodeType, stopSearchNode ) ; … … 940 940 } 941 941 return null ; 942 }, 943 944 /** 945 * Current implementation for ScrollIntoView (due to #1462). We don't have 946 * a complete implementation here, just the things that fit our needs. 947 */ 948 ScrollIntoView : function( element, alignTop ) 949 { 950 // Get the element window. 951 var window = FCKTools.GetElementWindow( element ) ; 952 var windowHeight = FCKTools.GetViewPaneSize( window ).Height ; 953 954 // Starts the offset that will be scrolled with the negative value of 955 // the visible window height. 956 var offset = windowHeight * -1 ; 957 958 // Appends the height it we are about to align the bottoms. 959 if ( alignTop === false ) 960 { 961 offset += element.offsetHeight ; 962 963 // Consider the margin in the scroll, which is ok for our current 964 // needs, but needs investigation if we will be using this function 965 // in other places. 966 offset += parseInt( this.GetCurrentElementStyle( window, element, 'marginBottom' ) || 0, 10 ) ; 967 } 968 969 // Appends the offsets for the entire element hierarchy. 970 offset += element.offsetTop ; 971 while ( ( element = element.parentNode ) ) 972 offset += element.offsetTop || 0 ; 973 974 // Scroll the window to the desired position, if not already visible. 975 var currentScroll = FCKTools.GetScrollPosition( window ).Y ; 976 if ( offset > 0 && offset > currentScroll ) 977 window.scrollTo( 0, offset ) ; 942 978 } 943 979 } ; -
FCKeditor/trunk/_whatsnew.html
r1120 r1124 132 132 and "More colors..." buttons were improperly styled in the color selector panels 133 133 (Opera too).</li> 134 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1462">#1462</a>] The enter 135 key will not any more scroll the main window.</li> 134 136 </ul> 135 137 </li> 136 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1562">#1562</a>] Fixed the issue where empty paragraphs 137 are added around page breaks each time the user switches to Source mode.</li> 138 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1562">#1562</a>] Fixed 139 the issue where empty paragraphs are added around page breaks each time the user 140 switches to Source mode.</li> 138 141 </ul> 139 142 <h3>