X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki.widgets%2Fmw.widgets.CheckMatrixWidget.js;h=b1ab0d2f16908cc28f45ffa3c98f805bfcf6e8ff;hb=9097f95ecc3c45f9265779e0051658ed9e2d2c91;hp=01165ca0821f7cf1d17ca604defa3d83ab4dcba2;hpb=1dee28cb5f1efd6d9e14d6cc1d0c73c3f69269b4;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/mediawiki.widgets/mw.widgets.CheckMatrixWidget.js b/resources/src/mediawiki.widgets/mw.widgets.CheckMatrixWidget.js index 01165ca082..b1ab0d2f16 100644 --- a/resources/src/mediawiki.widgets/mw.widgets.CheckMatrixWidget.js +++ b/resources/src/mediawiki.widgets/mw.widgets.CheckMatrixWidget.js @@ -21,6 +21,8 @@ mw.widgets.CheckMatrixWidget = function MWWCheckMatrixWidget( config ) { var $headRow = $( '' ), $table = $( '' ), + $thead = $( '' ), + $tbody = $( '' ), widget = this; config = config || {}; @@ -40,14 +42,14 @@ $headRow.append( $( '' ), labelField = new OO.ui.FieldLayout( @@ -63,7 +65,7 @@ $row.append( $( '
' ).text( '\u00A0' ) ); // Iterate over the columns object (ignore the value) - // eslint-disable-next-line no-restricted-properties + // eslint-disable-next-line no-jquery/no-each-util $.each( this.columns, function ( columnLabel ) { - $headRow.append( $( '' ).html( columnLabel ) ); + $headRow.append( $( '' ).html( columnLabel ) ); } ); - $table.append( $headRow ); + $thead.append( $headRow ); // Build table - // eslint-disable-next-line no-restricted-properties + // eslint-disable-next-line no-jquery/no-each-util $.each( this.rows, function ( rowLabel, rowTag ) { var $row = $( '
' ).append( labelField.$element ) ); // Columns - // eslint-disable-next-line no-restricted-properties + // eslint-disable-next-line no-jquery/no-each-util $.each( widget.columns, function ( columnLabel, columnTag ) { var thisTag = columnTag + '-' + rowTag, checkbox = new OO.ui.CheckboxInputWidget( { @@ -78,8 +80,11 @@ $row.append( $( '' ).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' ) @@ -138,7 +143,7 @@ // setDisabled sometimes gets called before the widget is ready if ( this.checkboxes && Object.keys( this.checkboxes ).length > 0 ) { // Propagate to all checkboxes and update their disabled state - // eslint-disable-next-line no-restricted-properties + // eslint-disable-next-line no-jquery/no-each-util $.each( this.checkboxes, function ( name, checkbox ) { checkbox.setDisabled( widget.isTagDisabled( name ) ); } );