Bartosz Dziewoński has uploaded a new change for review.

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

Change subject: Theme: Add theme classes to $icon and $indicator only
......................................................................

Theme: Add theme classes to $icon and $indicator only

Previously we added them to $element, which meant that they continued
to apply to nested widgets, which proved problematic in
PopupButtonWidget.

Also remove now-unnecessary CSS selectors.

This would be a breaking change for third-party themes, if any existed.

Change-Id: Ie93e4d6ed5637cdd95367729e1349a6da923f461
---
M src/Theme.js
M src/themes/mediawiki/icons.json
M src/themes/mediawiki/indicators.json
3 files changed, 12 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/02/231602/1

diff --git a/src/Theme.js b/src/Theme.js
index 92de72e..13ef5bb 100644
--- a/src/Theme.js
+++ b/src/Theme.js
@@ -40,9 +40,17 @@
  * @return {Object.<string,string[]>} Categorized class names with `on` and 
`off` lists
  */
 OO.ui.Theme.prototype.updateElementClasses = function ( element ) {
-       var classes = this.getElementClasses( element );
+       var $elements = $( [] ),
+               classes = this.getElementClasses( element );
 
-       element.$element
+       if ( element.$icon ) {
+               $elements = $elements.add( element.$icon );
+       }
+       if ( element.$indicator ) {
+               $elements = $elements.add( element.$indicator );
+       }
+
+       $elements
                .removeClass( classes.off.join( ' ' ) )
                .addClass( classes.on.join( ' ' ) );
 };
diff --git a/src/themes/mediawiki/icons.json b/src/themes/mediawiki/icons.json
index f351b5b..a79b329 100644
--- a/src/themes/mediawiki/icons.json
+++ b/src/themes/mediawiki/icons.json
@@ -1,6 +1,6 @@
 {
        "selectorWithoutVariant": ".oo-ui-icon-{name}",
-       "selectorWithVariant": ".oo-ui-image-{variant} .oo-ui-icon-{name}, 
.oo-ui-image-{variant}.oo-ui-icon-{name}",
+       "selectorWithVariant": ".oo-ui-image-{variant}.oo-ui-icon-{name}",
        "intro": "@import '../../../../src/styles/common';",
        "variants": {
                "invert": {
diff --git a/src/themes/mediawiki/indicators.json 
b/src/themes/mediawiki/indicators.json
index 3d66337..5a83258 100644
--- a/src/themes/mediawiki/indicators.json
+++ b/src/themes/mediawiki/indicators.json
@@ -1,6 +1,6 @@
 {
        "selectorWithoutVariant": ".oo-ui-indicator-{name}",
-       "selectorWithVariant": ".oo-ui-image-{variant} .oo-ui-indicator-{name}, 
.oo-ui-image-{variant}.oo-ui-indicator-{name}",
+       "selectorWithVariant": ".oo-ui-image-{variant}.oo-ui-indicator-{name}",
        "intro": "@import '../../../../src/styles/common';",
        "variants": {
                "invert": {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie93e4d6ed5637cdd95367729e1349a6da923f461
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>

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

Reply via email to