From 96ef35a58ab1f12a8aa19053ace92a9f94bf0c7d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Mon, 8 Aug 2016 22:37:49 +0200 Subject: [PATCH] HTMLForm: Add OOUI support for 'multiselect' with 'dropdown' => true Using CapsuleMultiselectWidget. Change-Id: I816739bc3acd40ee9d8b67e19ff3e4296fce66d3 --- .../htmlform/fields/HTMLMultiSelectField.php | 2 + .../src/mediawiki/htmlform/multiselect.js | 68 ++++++++++++++++--- 2 files changed, 60 insertions(+), 10 deletions(-) diff --git a/includes/htmlform/fields/HTMLMultiSelectField.php b/includes/htmlform/fields/HTMLMultiSelectField.php index c9fcb0992f..fee5d6344a 100644 --- a/includes/htmlform/fields/HTMLMultiSelectField.php +++ b/includes/htmlform/fields/HTMLMultiSelectField.php @@ -120,6 +120,8 @@ class HTMLMultiSelectField extends HTMLFormField implements HTMLNestedFilterable * @return OOUI\CheckboxMultiselectInputWidget */ public function getInputOOUI( $value ) { + $this->mParent->getOutput()->addModules( 'oojs-ui-widgets' ); + $attr = $this->getTooltipAndAccessKey(); $attr['id'] = $this->mID; $attr['name'] = "{$this->mName}[]"; diff --git a/resources/src/mediawiki/htmlform/multiselect.js b/resources/src/mediawiki/htmlform/multiselect.js index a8786efa5b..9ab253262c 100644 --- a/resources/src/mediawiki/htmlform/multiselect.js +++ b/resources/src/mediawiki/htmlform/multiselect.js @@ -32,9 +32,9 @@ function convertCheckboxesToMulti( $oldContainer, type ) { var $fieldLabel = $( '' ), - $td = $( '' ), - $fieldLabelText = $( '