Ticket #3092: 3092_2.patch

File 3092_2.patch, 1.4 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/stylescombo/plugin.js

     
    158158                                                var elementPath,
    159159                                                        element = selection.getSelectedElement(),
    160160                                                        elementName = element && element.getName(),
    161                                                         isInline = elementName &&
    162                                                                 !CKEDITOR.dtd.$block[ elementName ] &&
    163                                                                 !CKEDITOR.dtd.$listItem[ elementName ] &&
    164                                                                 !CKEDITOR.dtd.$tableContent[ elementName ];
     161                                                        elementPath = new CKEDITOR.dom.elementPath( element || selection.getStartElement() );
    165162
    166163                                                var counter = [ 0, 0, 0, 0 ];
    167 
    168                                                 if ( !element || isInline )
    169                                                         elementPath = new CKEDITOR.dom.elementPath( selection.getStartElement() );
    170 
    171164                                                this.showAll();
    172165                                                this.unmarkAll();
    173 
    174166                                                for ( var name in styles )
    175167                                                {
    176168                                                        var style = styles[ name ],
     
    190182                                                        }
    191183                                                        else
    192184                                                        {
    193                                                                 if ( elementPath )
    194                                                                 {
    195                                                                         if ( style.checkActive( elementPath ) )
    196                                                                                 this.mark( name );
    197 
    198                                                                         counter[ type ]++;
     185                                                                if ( style.checkActive( elementPath ) )
     186                                                                        this.mark( name );
    199187
    200                                                                 }
    201                                                                 else
    202                                                                         this.hideItem( name );
     188                                                                counter[ type ]++;
    203189                                                        }
    204190                                                }
    205191
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy