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

Change subject: OutlineOptionWidget: Follow-up de9058299f: don't duplicate 
parent's logic
......................................................................


OutlineOptionWidget: Follow-up de9058299f: don't duplicate parent's logic

The parent already checks pressable/selectable and sets the state,
we don't need to do that again here after calling the parent method.

Change-Id: I5f30f4bb4121f0ee974d4685416d5d3e43adda7c
---
M src/widgets/OutlineOptionWidget.js
1 file changed, 8 insertions(+), 14 deletions(-)

Approvals:
  Esanders: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/widgets/OutlineOptionWidget.js 
b/src/widgets/OutlineOptionWidget.js
index 2b2d278..2dbfa7f 100644
--- a/src/widgets/OutlineOptionWidget.js
+++ b/src/widgets/OutlineOptionWidget.js
@@ -82,13 +82,10 @@
  */
 OO.ui.OutlineOptionWidget.prototype.setPressed = function ( state ) {
        OO.ui.OutlineOptionWidget.parent.prototype.setPressed.call( this, state 
);
-       if ( this.constructor.static.pressable ) {
-               this.pressed = !!state;
-               if ( this.pressed ) {
-                       this.setFlags( 'progressive' );
-               } else if ( !this.selected ) {
-                       this.clearFlags();
-               }
+       if ( this.pressed ) {
+               this.setFlags( 'progressive' );
+       } else if ( !this.selected ) {
+               this.clearFlags();
        }
        return this;
 };
@@ -126,13 +123,10 @@
  */
 OO.ui.OutlineOptionWidget.prototype.setSelected = function ( state ) {
        OO.ui.OutlineOptionWidget.parent.prototype.setSelected.call( this, 
state );
-       if ( this.constructor.static.selectable ) {
-               this.selected = !!state;
-               if ( this.selected ) {
-                       this.setFlags( 'progressive' );
-               } else {
-                       this.clearFlags();
-               }
+       if ( this.selected ) {
+               this.setFlags( 'progressive' );
+       } else {
+               this.clearFlags();
        }
        return this;
 };

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5f30f4bb4121f0ee974d4685416d5d3e43adda7c
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Catrope <r...@wikimedia.org>
Gerrit-Reviewer: Esanders <esand...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to