Yaron Koren has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/350507 )
Change subject: Fix for 474cb30ce9f7 - it broke the 'tree' input
......................................................................
Fix for 474cb30ce9f7 - it broke the 'tree' input
Change-Id: I3129198eee8f40ff17a760d29395e26a30e764f4
---
M includes/forminputs/PF_TreeInput.php
1 file changed, 12 insertions(+), 10 deletions(-)
Approvals:
Yaron Koren: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/forminputs/PF_TreeInput.php
b/includes/forminputs/PF_TreeInput.php
index 7069de0..860c1d4 100644
--- a/includes/forminputs/PF_TreeInput.php
+++ b/includes/forminputs/PF_TreeInput.php
@@ -167,11 +167,21 @@
$key_id = str_replace( ' ', '-', "$key_prefix-$index" );
if ( !$hidenode ) {
+ $liAttribs = array( 'id' => $key_id );
+ if ( in_array( $node->title, $current_selection ) ) {
+ $liAttribs['class'] = 'selected';
+ }
+ if ( $depth > 0 ) {
+ $liAttribs['data'] = "'expand': true";
+ }
+ // For some reason, the Dynatree JS library requires
+ // unclosed <li> tags; "<li>...</li>" won't work.
+ $text .= Html::openElement( 'li', $liAttribs );
+
$dummy_str = "REPLACE THIS TEXT";
if ( self::$multipleSelect ) {
$input_name .= "[" . $dummy_str . "]";
}
-
$nodeAttribs = array(
'tabindex' => $wgPageFormsTabIndex,
'id' => "chb-$key_id",
@@ -180,17 +190,9 @@
if ( in_array( $node->title, $current_selection ) ) {
$nodeAttribs['checked'] = true;
}
- $singleInput = Html::input( $input_name, $node->title,
$inputType, $nodeAttribs );
- $liAttribs = array( 'id' => $key_id );
- if ( in_array( $node->title, $current_selection ) ) {
- $liAttribs['class'] = 'selected';
- }
- if ( $depth > 0 ) {
- $liAttribs['data'] = "'expand': true";
- }
+ $text .= Html::input( $input_name, $node->title,
$inputType, $nodeAttribs );
- $text .= Html::rawElement( 'li', $liAttribs,
$singleInput );
$text .= $node->title . "\n";
}
--
To view, visit https://gerrit.wikimedia.org/r/350507
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3129198eee8f40ff17a760d29395e26a30e764f4
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>
Gerrit-Reviewer: Yaron Koren <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits