Ticket #2403: forceenter.patch

File forceenter.patch, 1.4 KB (added by robmueller, 15 years ago)

Updated patch

  • editor/_source/classes/fckenterkey.js

     
    481481                        {
    482482                                var sPreviousBlockTag = ePreviousBlock.tagName.toUpperCase() ;
    483483
    484                                 // If is a header tag, or we are in a Shift+Enter (#77),
    485                                 // create a new block element (later in the code).
    486                                 if ( !this._HasShift && !(/^H[1-6]$/).test( sPreviousBlockTag ) )
     484                                // If is a header tag, or we are in a Shift+Enter (#77), or
     485                                // ForceEnterMode, create a new block element (later in the code).
     486                                // Except in ForceEnterMode, if last block is same as block we want
     487                                // to create or a list item, clone the last block instead. This
     488                                // stops Enter always ending a list, and if a block has attributes
     489                                // (eg dir="rtl"), they're cloned to the new block
     490                                if ( !this._HasShift && !(/^H[1-6]$/).test( sPreviousBlockTag ) &&
     491                                        ( !FCKConfig.ForceEnterMode || sPreviousBlockTag == blockTag.toUpperCase() || sPreviousBlockTag == 'LI' ) )
    487492                                {
    488493                                        // Otherwise, duplicate the previous block.
    489494                                        eNewBlock = FCKDomTools.CloneElement( ePreviousBlock ) ;
    490495                                }
    491496                        }
    492                         else if ( eNextBlock )
     497                        else if ( eNextBlock && !FCKConfig.ForceEnterMode )
    493498                                eNewBlock = FCKDomTools.CloneElement( eNextBlock ) ;
    494499
    495500                        if ( !eNewBlock )
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy