Changeset 543

Show
Ignore:
Timestamp:
2007-07-26 01:03:49 (16 months ago)
Author:
martinkou
Message:

Fixed #581 : Fixed the issue where a <input name="style"> found inside the editor form would break the fit window function.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/commandclasses/fckfitwindow.js

    r529 r543  
    5757                        if ( eParent.nodeType == 1 ) 
    5858                        { 
     59                                var hijackNode = null ; 
     60                                var hijackSibling = null ; 
     61                                if ( eParent.tagName.toLowerCase() == 'form' && eParent.elements.namedItem( 'style' ) ) 
     62                                { 
     63                                        hijackNode = eParent.elements.namedItem( 'style' ) ; 
     64                                        hijackSibling = hijackNode.nextSibling ; 
     65                                        eParent.removeChild( hijackNode ) ; 
     66                                } 
    5967                                eParent._fckSavedStyles = FCKTools.SaveStyles( eParent ) ; 
    6068                                eParent.style.zIndex = FCKConfig.FloatingPanelsZIndex - 1 ; 
     69                                if ( hijackNode ) 
     70                                { 
     71                                        if ( hijackSibling ) 
     72                                                eParent.insertBefore( hijackNode, hijackSibling ) ; 
     73                                        else 
     74                                                eParent.appendChild( hijackNode ) ; 
     75                                } 
    6176                        } 
    6277                }