#172 Applying Class styles to tables in IE

Version 2.x
closed-fixed
Editor (144)
5
2005-12-23
2005-11-07
No

Currently if the users tries to apply a class to a
table in IE using the styles combo the change isn't
visible until the content is reloaded (changing to
source view and back to wysiwyg for example).

This is due to applying the class attribute directly
instead of using the attribute name className.

change FCKStyleDef.prototype._AddAttributes in
classes\fckstyledef_ie.js adding a check for class:

if ( a.toLowerCase() == 'style' )
targetElement.style.cssText = this.Attributes[a] ;
else if (a.toLowerCase() == 'class')
targetElement.setAttribute( 'className' ,
this.Attributes[a], 0 ) ;
else
targetElement.setAttribute( a, this.Attributes[a], 0 ) ;

Discussion

  • kbittner

    kbittner - 2005-11-07

    Logged In: YES
    user_id=1070534

    Thank you! Kristi Bittner

     
  • Nobody/Anonymous

    Logged In: NO

    I tried applying this patch and it didn't seem to work. I also
    tried your fix for the xhtml tags in IE and that did not work
    either. Is there something I am missing? I updated the
    appropriate .js files, cleared my cache and updated, but I still
    have the same issues. I have to look at the source before a
    table css class appears in the edtior. Thanks.

     
  • Alfonso Martinez

    Logged In: YES
    user_id=1356422

    You must change your setup to use the source files(1) or
    package them using the packager
    http://www.fckeditor.net/_shared/userfiles/file/fckeditor.packager_2.0.zip

    1:
    "With the JavaScript, ASP and PHP integration files, you can
    set the QueryString value "fcksource=true" to load the
    editor using the source files (located in the _source
    directory) instead of the compressed ones. Thanks to Kae
    Verens for the suggestion."

     
  • Nobody/Anonymous

    Logged In: NO

    Thanks for the quick reply.

     
  • ohira

    ohira - 2005-12-10

    Logged In: YES
    user_id=1274313

    Thanks - works perfectly...

    Here the complete changes for those who dont use the packager.

    #In fckeditorcode_ie_2.js
    #replace
    FCKStyleDef.prototype._AddAttributes=function(A){for (var a
    in this.Attributes){if (a.toLowerCase()=='style')
    A.style.cssText=this.Attributes[a];else
    A.setAttribute(a,this.Attributes[a],0);};};
    #with
    FCKStyleDef.prototype._AddAttributes=function(A){for (var a
    in this.Attributes){if (a.toLowerCase()=='style')
    A.style.cssText=this.Attributes[a];else if (a.toLowerCase()
    == 'class') A.setAttribute( 'className' ,
    this.Attributes[a], 0 );else
    A.setAttribute(a,this.Attributes[a],0);};};

    Regards, Oliver

     
  • Frederico Caldeira Knabben

    • assigned_to: nobody --> fredck
    • status: open --> open-fixed
     
  • Frederico Caldeira Knabben

    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks