Ticket #738: 738.patch

File 738.patch, 1.9 KB (added by Martin Kou, 16 years ago)
  • _whatsnew.html

     
    7575                        are now properly sized in Opera.</li>
    7676                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/1782">#1782</a>] Clicking on radio
    7777                        buttons or checkboxes in the editor in IE will no longer cause lockups in IE.</li>
     78                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/738">#738</a>] Button type can now
     79                        be changed after creation.</li>
    7880        </ul>
    7981        <p>
    8082                <a href="_whatsnew_history.html">See previous versions history</a>
  • editor/dialog/fck_button.html

     
    4747                GetE('txtName').value   = oActiveEl.name ;
    4848                GetE('txtValue').value  = oActiveEl.value ;
    4949                GetE('txtType').value   = oActiveEl.type ;
    50 
    51                 GetE('txtType').disabled = true ;
    5250        }
    5351        else
    5452                oActiveEl = null ;
     
    6866                oActiveEl.type = GetE('txtType').value ;
    6967                oActiveEl = oEditor.FCK.InsertElement( oActiveEl ) ;
    7068        }
     69        else if ( oActiveEl && oActiveEl.type != GetE( 'txtType' ).value )
     70        {
     71                var oNewEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
     72                oNewEl.type = GetE( 'txtType' ).value ;
     73                oActiveEl = oEditor.FCK.InsertElement( oNewEl ) ;
    7174
     75                // FCKDialog.SelectionData is broken by now since we've deleted the previously selected element.
     76                // So we need to reassign it.
     77                if ( oEditor.FCKBrowserInfo.IsIE && oEditor.FCKDialog.SelectionData )
     78                {
     79                        var range = oEditor.FCK.EditorDocument.body.createControlRange() ;
     80                        range.add( oActiveEl ) ;
     81                        oEditor.FCKDialog.SelectionData = range ;
     82                }
     83        }
     84
    7285        oActiveEl.name = GetE('txtName').value ;
    7386        SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
    7487
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy