Bartosz Dziewoński has uploaded a new change for review. https://gerrit.wikimedia.org/r/176488
Change subject: [BREAKING CHANGE] ButtonWidget: Don't default 'target' to '_blank' ...................................................................... [BREAKING CHANGE] ButtonWidget: Don't default 'target' to '_blank' target=_blank has its use cases, but it definitely shouldn't be the default behavior. Bug: T75452 Change-Id: I88b7bc1b562bca2a63b611b1d33dd9d534297e68 --- M demos/widgets.php M php/widgets/ButtonWidget.php M src/widgets/ButtonWidget.js 3 files changed, 2 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/88/176488/1 diff --git a/demos/widgets.php b/demos/widgets.php index 305d7c7..1217289 100644 --- a/demos/widgets.php +++ b/demos/widgets.php @@ -31,12 +31,10 @@ new OOUI\ButtonWidget( array( 'label' => 'LTR', 'href' => '?dir=ltr', - 'target' => null, ) ), new OOUI\ButtonWidget( array( 'label' => 'RTL', 'href' => '?dir=rtl', - 'target' => null, ) ), ) ) ); diff --git a/php/widgets/ButtonWidget.php b/php/widgets/ButtonWidget.php index 0464ed2..1dff2bb 100644 --- a/php/widgets/ButtonWidget.php +++ b/php/widgets/ButtonWidget.php @@ -27,9 +27,6 @@ * @param string $config['target'] Target to open hyperlink in */ public function __construct( array $config = array() ) { - // Configuration initialization - $config = array_merge( array( 'target' => '_blank' ), $config ); - // Parent constructor parent::__construct( $config ); @@ -49,7 +46,7 @@ ->appendContent( $this->button ); $this->setHref( isset( $config['href'] ) ? $config['href'] : null ); - $this->setTarget( $config['target'] ); + $this->setTarget( isset( $config['target'] ) ? $config['target'] : null ); } /** diff --git a/src/widgets/ButtonWidget.js b/src/widgets/ButtonWidget.js index 17ac0ee..a2484f2 100644 --- a/src/widgets/ButtonWidget.js +++ b/src/widgets/ButtonWidget.js @@ -17,7 +17,7 @@ */ OO.ui.ButtonWidget = function OoUiButtonWidget( config ) { // Configuration initialization - config = $.extend( { target: '_blank' }, config ); + config = config || {}; // Parent constructor OO.ui.ButtonWidget.super.call( this, config ); -- To view, visit https://gerrit.wikimedia.org/r/176488 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I88b7bc1b562bca2a63b611b1d33dd9d534297e68 Gerrit-PatchSet: 1 Gerrit-Project: oojs/ui Gerrit-Branch: master Gerrit-Owner: Bartosz Dziewoński <matma....@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits