Catrope has uploaded a new change for review. https://gerrit.wikimedia.org/r/314207
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(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/07/314207/1 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: newchange Gerrit-Change-Id: I5f30f4bb4121f0ee974d4685416d5d3e43adda7c Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Catrope <r...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits