2 * Legacy emulation for the now depricated skins/common/htmlform.js
9 $.extend( true, mw
.legacy
, {
11 /* Global Variables */
14 'selectOrOtherSelectChanged': function( e
) {
21 } else if ( e
.srcElement
) {
22 select
= e
.srcElement
;
25 if ( select
.nodeType
== 3 ) {
26 select
= select
.parentNode
;
29 var textbox
= document
.getElementById( id
+ '-other' );
30 if ( select
.value
== 'other' ) {
31 textbox
.disabled
= false;
33 textbox
.disabled
= true;
41 $( document
).ready( function() {
42 // Find select-or-other fields
43 $( 'select .mw-htmlform-select-or-other' ).each( function() {
44 $(this).change( function() { mw
.legacy
.htmlforms
.selectOrOtherSelectChanged(); } );
45 // Use a fake event to update it.
46 mw
.legacy
.htmlforms
.selectOrOtherSelectChanged( { 'target': $(this).get( 0 ) } );
50 } )( jQuery
, mediaWiki
);