Ticket #1853: 1853_2.patch
File 1853_2.patch, 2.8 KB (added by , 16 years ago) |
---|
-
_whatsnew.html
92 92 opened.</li> 93 93 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2024">#2024</a>] Fixed 94 94 JavaScript error in IE when the user tries to open dialogs in Source mode.</li> 95 <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1853">#1853</a>] Setting 96 ShiftEnterMode to p or div now works correctly when EnterMode is br.</li> 95 97 </ul> 96 98 <h3> 97 99 Version 2.6 Beta 1</h3> -
editor/_source/classes/fckdomrange.js
755 755 * and the PreviousBlock value will be null. The same is valid for the 756 756 * NextBlock value if the range was at the end of the block. 757 757 */ 758 SplitBlock : function( )758 SplitBlock : function( forceBlockTag ) 759 759 { 760 var blockTag = forceBlockTag || FCKConfig.EnterMode ; 761 760 762 if ( !this._Range ) 761 763 this.MoveToSelection() ; 762 764 … … 768 770 var eEndBlock = this.EndBlock ; 769 771 var oElementPath = null ; 770 772 771 if ( FCKConfig.EnterMode!= 'br' )773 if ( blockTag != 'br' ) 772 774 { 773 775 if ( !eStartBlock ) 774 776 { 775 eStartBlock = this.FixBlock( true ) ;777 eStartBlock = this.FixBlock( true, blockTag ) ; 776 778 eEndBlock = this.EndBlock ; // FixBlock may have fixed the EndBlock too. 777 779 } 778 780 779 781 if ( !eEndBlock ) 780 eEndBlock = this.FixBlock( false ) ;782 eEndBlock = this.FixBlock( false, blockTag ) ; 781 783 } 782 784 783 785 // Get the range position. … … 840 842 }, 841 843 842 844 // Transform a block without a block tag in a valid block (orphan text in the body or td, usually). 843 FixBlock : function( isStart )845 FixBlock : function( isStart, blockTag ) 844 846 { 845 847 // Bookmark the range so we can restore it later. 846 848 var oBookmark = this.CreateBookmark() ; … … 852 854 this.Expand( 'block_contents' ) ; 853 855 854 856 // Create the fixed block. 855 var oFixedBlock = this.Window.document.createElement( FCKConfig.EnterMode) ;857 var oFixedBlock = this.Window.document.createElement( blockTag ) ; 856 858 857 859 // Move the contents of the temporary range to the fixed block. 858 860 this.ExtractContents().AppendTo( oFixedBlock ) ; -
editor/_source/classes/fckenterkey.js
398 398 // Get the current selection. 399 399 var oRange = range || new FCKDomRange( this.Window ) ; 400 400 401 var oSplitInfo = oRange.SplitBlock( ) ;401 var oSplitInfo = oRange.SplitBlock( blockTag ) ; 402 402 403 403 if ( oSplitInfo ) 404 404 {