OOjs UI: Backport aadaa8a1, 9aba218a
authorBartosz Dziewoński <matma.rex@gmail.com>
Tue, 13 Oct 2015 12:24:36 +0000 (14:24 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Tue, 13 Oct 2015 12:24:36 +0000 (14:24 +0200)
Important tweaks for mw.widgets.CategorySelector, which will rise to
prominence soon when we deploy mw.Upload.BookletLayout in VisualEditor.

Bug: T114945
Bug: T115010
Change-Id: I4236a7c64469faa7476bcab9bd0a0f8497101fe2

resources/lib/oojs-ui/oojs-ui-mediawiki-noimages.css
resources/lib/oojs-ui/oojs-ui.js

index 4b65ad4..08edbc6 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Local backports:
+ *
+ * - aadaa8a187d36ded603eebbdff47efe133908f6c
+ *   CapsuleMultiSelectWidget: Set 'background-color' rather than 'background'
+ *   Required for mw.widgets.CategorySelector's pending state to display.
+ */
+
 /*!
  * OOjs UI v0.12.11
  * https://www.mediawiki.org/wiki/OOjs_UI
        width: 100%;
 }
 .oo-ui-capsuleMultiSelectWidget-handle {
-       background: #ffffff;
+       background-color: #ffffff;
        cursor: text;
        min-height: 2.4em;
        margin-right: 0.5em;
index e433e91..951acc7 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Local backports:
+ *
+ * - 9aba218a882ff45b07410a3ce9d5cdfd8e567e26
+ *   CapsuleMultiSelectWidget: When 'allowArbitrary' is true, don't require 'Enter' to confirm
+ *   Required for more intuitive behavior of mw.widgets.CategorySelector.
+ */
+
 /*!
  * OOjs UI v0.12.11
  * https://www.mediawiki.org/wiki/OOjs_UI
@@ -13455,6 +13463,9 @@ OO.ui.CapsuleMultiSelectWidget.prototype.onInputFocus = function () {
  * @param {jQuery.Event} event
  */
 OO.ui.CapsuleMultiSelectWidget.prototype.onInputBlur = function () {
+       if ( this.allowArbitrary && this.$input.val().trim() !== '' ) {
+               this.addItemsFromData( [ this.$input.val() ] );
+       }
        this.clearInput();
 };