Esanders has uploaded a new change for review. https://gerrit.wikimedia.org/r/204293
Change subject: Simplify OO.ui.SelectWidget#getTargetItem ...................................................................... Simplify OO.ui.SelectWidget#getTargetItem $#data can be called on an empty collection, so we can remove the length check. Change-Id: Ic7fb8023b424dd8f5d4170f3ac39432f091d52d7 --- M src/widgets/SelectWidget.js 1 file changed, 1 insertion(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/93/204293/1 diff --git a/src/widgets/SelectWidget.js b/src/widgets/SelectWidget.js index 3aba716..4cc6282 100644 --- a/src/widgets/SelectWidget.js +++ b/src/widgets/SelectWidget.js @@ -332,11 +332,7 @@ * @return {OO.ui.OptionWidget|null} Outline item widget, `null` if none was found */ OO.ui.SelectWidget.prototype.getTargetItem = function ( e ) { - var $item = $( e.target ).closest( '.oo-ui-optionWidget' ); - if ( $item.length ) { - return $item.data( 'oo-ui-optionWidget' ); - } - return null; + return $( e.target ).closest( '.oo-ui-optionWidget' ).data( 'oo-ui-optionWidget' ) || null; }; /** -- To view, visit https://gerrit.wikimedia.org/r/204293 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic7fb8023b424dd8f5d4170f3ac39432f091d52d7 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Esanders <esand...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits