r99313 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99312‎ | r99313 | r99314 >
Date:15:12, 8 October 2011
Author:maxsem
Status:ok
Tags:
Comment:
Restrict max size of <select> to 10 items
Modified paths:
  • /trunk/extensions/ApiSandbox/ext.apiSandbox.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ApiSandbox/ext.apiSandbox.js
@@ -251,7 +251,7 @@
252252 function select( values, attributes, selected ) {
253253 attributes['class'] = 'api-sandbox-input';
254254 if ( isset( attributes.multiple ) ) {
255 - attributes['size'] = values.length.toString();
 255+ attributes['size'] = Math.min( values.length, 10 );
256256 }
257257 var s = '';
258258 if ( typeof selected != 'array' ) {

Status & tagging log