Prtksxna has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/268072

Change subject: OO.ui.CapsuleMultiSelectWidget: Extend config instead of when 
setting property
......................................................................

OO.ui.CapsuleMultiSelectWidget: Extend config instead of when setting property

Change-Id: I91476d5394a9177625d16e91063e51ddc6cab1e1
---
M src/widgets/CapsuleMultiSelectWidget.js
1 file changed, 8 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/72/268072/1

diff --git a/src/widgets/CapsuleMultiSelectWidget.js 
b/src/widgets/CapsuleMultiSelectWidget.js
index bffba7c..0ea8429 100644
--- a/src/widgets/CapsuleMultiSelectWidget.js
+++ b/src/widgets/CapsuleMultiSelectWidget.js
@@ -63,11 +63,14 @@
 OO.ui.CapsuleMultiSelectWidget = function OoUiCapsuleMultiSelectWidget( config 
) {
        var $tabFocus;
 
-       // Configuration initialization
-       config = config || {};
-
        // Parent constructor
        OO.ui.CapsuleMultiSelectWidget.parent.call( this, config );
+
+       // Configuration initialization
+       config = $.extend( {
+               allowArbitrary: false,
+               $overlay: this.$element
+       }, config );
 
        // Properties (must be set before mixin constructor calls)
        this.$input = config.popup ? null : $( '<input>' );
@@ -93,8 +96,8 @@
 
        // Properties
        this.$content = $( '<div>' );
-       this.allowArbitrary = !!config.allowArbitrary;
-       this.$overlay = config.$overlay || this.$element;
+       this.allowArbitrary = config.allowArbitrary;
+       this.$overlay = config.$overlay;
        this.menu = new OO.ui.FloatingMenuSelectWidget( $.extend(
                {
                        widget: this,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I91476d5394a9177625d16e91063e51ddc6cab1e1
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Prtksxna <[email protected]>

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

Reply via email to