installer: Do not wrongly hide namespace input field
authorFomafix <fomafix@googlemail.com>
Fri, 27 Apr 2018 14:27:39 +0000 (16:27 +0200)
committerLegoktm <legoktm@member.fsf.org>
Wed, 23 May 2018 05:55:19 +0000 (05:55 +0000)
When the radio button is already on "other" then the input field for
the namespace should not get hidden by JavaScript on load.

Also remove the readonly attribute in HTML because the readonly
attribute can not get removed with disabled JavaScript.

Change-Id: I8cfde90d791765234572caf00b731881ac2eda48
(cherry picked from commit 31a472655b246df3c072d36959afcb7d2897889d)

includes/installer/WebInstallerName.php
mw-config/config.js

index 81a107d..50c88ae 100644 (file)
@@ -76,7 +76,7 @@ class WebInstallerName extends WebInstallerPage {
                        $this->parent->getTextBox( [
                                'var' => 'wgMetaNamespace',
                                'label' => '', // @todo Needs a label?
-                               'attribs' => [ 'readonly' => 'readonly', 'class' => 'enabledByOther' ]
+                               'attribs' => [ 'class' => 'enabledByOther' ]
                        ] ) .
                        $this->getFieldsetStart( 'config-admin-box' ) .
                        $this->parent->getTextBox( [
index bb62067..99290f4 100644 (file)
@@ -73,7 +73,9 @@
 
                // Hide "other" textboxes by default
                // Should not be done in CSS for javascript disabled compatibility
-               $( '.enabledByOther' ).closest( '.config-block' ).hide();
+               if ( !$( '#config__NamespaceType_other' ).is( ':checked' ) ) {
+                       $( '.enabledByOther' ).closest( '.config-block' ).hide();
+               }
 
                // Enable/disable "other" textboxes
                $( '.enableForOther' ).click( function () {