r90129 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90128‎ | r90129 | r90130 >
Date:18:18, 15 June 2011
Author:mah
Status:deferred
Tags:
Comment:
Fixes Bug 21270 - “onclick handler for radio button in quiz extension
causes a javascript error if there is no shuffleButton”

Apply mybugs.mail's implementation of Bawolff's suggested fix.
Modified paths:
  • /trunk/extensions/Quiz/quiz.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Quiz/quiz.js
@@ -116,12 +116,16 @@
117117 };
118118 }
119119 input[j].onkeydown = function() {
120 - this.form.shuffleButton.disabled = true;
 120+ if( this.form.shuffleButton ) {
 121+ this.form.shuffleButton.disabled = true;
 122+ }
121123 };
122124 }
123125 if( input[j].className == 'check' ) {
124126 input[j].onclick = function() {
125 - this.form.shuffleButton.disabled = true;
 127+ if( this.form.shuffleButton ) {
 128+ this.form.shuffleButton.disabled = true;
 129+ }
126130 };
127131 }
128132 // Disable the submit button if the page is in preview mode

Status & tagging log