Ticket #3876: 3876_2.patch

File 3876_2.patch, 2.0 KB (added by Martin Kou, 15 years ago)
  • _source/plugins/dialogui/plugin.js

     
    337337                                        if ( elementDefinition[ 'default' ] )
    338338                                                attributes.checked = 'checked';
    339339                                        _.checkbox = new CKEDITOR.ui.dialog.uiElement( dialog, myDefinition, html, 'input', null, attributes );
    340                                         html.push( ' ', CKEDITOR.tools.htmlEncode( elementDefinition.label ) );
     340                                        html.push( ' <label for="', attributes.id, '">',
     341                                                        CKEDITOR.tools.htmlEncode( elementDefinition.label ),
     342                                                        '</label>' );
    341343                                        return html.join( '' );
    342344                                };
    343345
    344                                 CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'label', null, null, innerHTML );
     346                                CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, htmlList, 'span', null, null, innerHTML );
    345347                        },
    346348
    347349                        /**
     
    398400                                                                                id : null,
    399401                                                                                title : title
    400402                                                                        }, true ),
    401                                                         inputHtml = [],
    402403                                                        inputAttributes =
    403404                                                        {
    404405                                                                type : 'radio',
    405406                                                                'class' : 'cke_dialog_ui_radio_input',
    406407                                                                name : commonName,
    407408                                                                value : value
    408                                                         };
     409                                                        },
     410                                                        inputHtml = [];
    409411                                                if ( me._['default'] == value )
    410412                                                        inputAttributes.checked = 'checked';
    411413                                                cleanInnerDefinition( inputDefinition );
    412414                                                cleanInnerDefinition( labelDefinition );
    413415                                                children.push( new CKEDITOR.ui.dialog.uiElement( dialog, inputDefinition, inputHtml, 'input', null, inputAttributes ) );
    414                                                 new CKEDITOR.ui.dialog.uiElement( dialog, labelDefinition, inputHtmlList, 'label', null, null,
    415                                                            inputHtml.join( '' ) + ' ' + item[0] );
     416                                                inputHtml.push( ' ' );
     417                                                new CKEDITOR.ui.dialog.uiElement( dialog, labelDefinition, inputHtml, 'label', null, { 'for' : inputAttributes.id },
     418                                                           item[0] );
     419                                                inputHtmlList.push( inputHtml.join( '' ) );
    416420                                        }
    417421                                        new CKEDITOR.ui.dialog.hbox( dialog, [], inputHtmlList, html );
    418422                                        return html.join( '' );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy