CheckMatrixWidget: Re-instate HTMLForm CheckMatrix styling
[lhc/web/wiklou.git] / resources / src / mediawiki.widgets / mw.widgets.CheckMatrixWidget.js
index 01165ca..73ee840 100644 (file)
@@ -21,6 +21,8 @@
        mw.widgets.CheckMatrixWidget = function MWWCheckMatrixWidget( config ) {
                var $headRow = $( '<tr>' ),
                        $table = $( '<table>' ),
+                       $thead = $( '<thead>' ),
+                       $tbody = $( '<tbody>' ),
                        widget = this;
                config = config || {};
 
@@ -44,7 +46,7 @@
                $.each( this.columns, function ( columnLabel ) {
                        $headRow.append( $( '<td>' ).html( columnLabel ) );
                } );
-               $table.append( $headRow );
+               $thead.append( $headRow );
 
                // Build table
                // eslint-disable-next-line no-restricted-properties
                                $row.append( $( '<td>' ).append( checkbox.$element ) );
                        } );
 
-                       $table.append( $row );
+                       $tbody.append( $row );
                } );
+               $table
+                       .addClass( 'mw-htmlform-matrix mw-widget-checkMatrixWidget-matrix' )
+                       .append( $thead, $tbody );
 
                this.$element
                        .addClass( 'mw-widget-checkMatrixWidget' )