Index: trunk/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js |
— | — | @@ -640,7 +640,9 @@ |
641 | 641 | } |
642 | 642 | if ( pitches.length ) { |
643 | 643 | // Select randomly using equal distribution of available pitches |
644 | | - var key = pitches[Math.round( Math.random() * ( pitches.length - 1 ) )]; |
| 644 | + var randomIndex = Math.round( Math.random() * Number.MAX_VALUE ) |
| 645 | + % pitches.length; |
| 646 | + var key = pitches[randomIndex]; |
645 | 647 | context.$ui.find( '.articleFeedback-pitches' ) |
646 | 648 | .css( 'width', context.$ui.width() ) |
647 | 649 | .find( '.articleFeedback-pitch[rel="' + key + '"]' ) |