jenkins-bot has submitted this change and it was merged.

Change subject: htmlform muliselect chosen: convert each list
......................................................................


htmlform muliselect chosen: convert each list

This change converts each checkbox list input separately, rather
than converting all together into a single select input.

Change-Id: Iec6687f7105cdb38fb92785aaa4357babaef1b4f
---
M resources/mediawiki/mediawiki.htmlform.js
1 file changed, 5 insertions(+), 12 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/mediawiki/mediawiki.htmlform.js 
b/resources/mediawiki/mediawiki.htmlform.js
index 77ceee4..8e764e1 100644
--- a/resources/mediawiki/mediawiki.htmlform.js
+++ b/resources/mediawiki/mediawiki.htmlform.js
@@ -90,7 +90,7 @@
                $td = $( '<td>' ),
                $fieldLabelText = $( '<label>' ),
                $container;
-               if ( type === 'table' ) {
+               if ( type === 'tr' ) {
                        addMulti( $oldContainer, $td );
                        $container = $( '<tr>' );
                        $container.append( $td );
@@ -110,18 +110,11 @@
 
        if ( $( '.mw-chosen' ).length ) {
                mw.loader.using( 'jquery.chosen', function () {
-                       var $toConvert,
-                       $converted;
-                       $toConvert = $( 'table .mw-chosen' );
-                       if ( $toConvert.length ) {
-                               $converted = convertCheckboxesToMulti( 
$toConvert, 'table' );
+                       $( '.mw-chosen' ).each( function () {
+                               var type = this.nodeName.toLowerCase(),
+                                       $converted = convertCheckboxesToMulti( 
$( this ), type );
                                $converted.find( '.htmlform-chzn-select' 
).chosen( { width: 'auto' } );
-                       }
-                       $toConvert = $( 'div .mw-chosen' );
-                       if ( $toConvert.length ) {
-                               $converted = convertCheckboxesToMulti( 
$toConvert, 'div' );
-                               $converted.find( '.htmlform-chzn-select' 
).chosen( { width: 'auto' } );
-                       }
+                       } );
                } );
        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/78213
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iec6687f7105cdb38fb92785aaa4357babaef1b4f
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ryan Lane <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Daniel Friesen <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Matmarex <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Spage <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to