Allow "size" attribute to HTMLSelectField
authorAlexandre Emsenhuber <mediawiki@emsenhuber.ch>
Sun, 6 Jul 2014 18:51:17 +0000 (20:51 +0200)
committerAlexandre Emsenhuber <mediawiki@emsenhuber.ch>
Sun, 6 Jul 2014 18:51:17 +0000 (20:51 +0200)
Pass this one to XmlSelect is provided.

Change-Id: I7ac345e1c219c8607895f9fc0fc2cef68c900ff8

includes/htmlform/HTMLSelectField.php

index c32b445..2bf9f8b 100644 (file)
@@ -27,8 +27,10 @@ class HTMLSelectField extends HTMLFormField {
                        $select->setAttribute( 'disabled', 'disabled' );
                }
 
-               if ( isset( $this->mParams['tabindex'] ) ) {
-                       $select->setAttribute( 'tabindex', $this->mParams['tabindex'] );
+               $allowedParams = array( 'tabindex', 'size' );
+               $customParams = $this->getAttributes( $allowedParams );
+               foreach( $customParams as $name => $value ) {
+                       $select->setAttribute( $name, $value );
                }
 
                if ( $this->mClass !== '' ) {