From 3a6b810dd40536339edb8335c4eed2c5b0f5f713 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Thu, 8 Jun 2017 19:08:59 +0200 Subject: [PATCH] EditPage: Fix 'id' attributes on buttons in non-OOUI mode Follow-up to ce2290e4817d78bbb400f1fec28cf4747eab8e1d. I really did not think that change through. Bug: T167390 Change-Id: I6d683cafe02137800925507d5e00663756002296 --- includes/EditPage.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index f79a2863e7..6be8771121 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -4335,8 +4335,6 @@ HTML $buttonLabel = $this->context->msg( $this->getSaveButtonLabel() )->text(); $attribs = [ - 'id' => 'wpSaveWidget', - 'inputId' => 'wpSave', 'name' => 'wpSave', 'tabindex' => ++$tabindex, ] + Linker::tooltipAndAccesskeyAttribs( 'save' ); @@ -4344,6 +4342,8 @@ HTML if ( $this->oouiEnabled ) { $saveConfig = OOUI\Element::configFromHtmlAttributes( $attribs ); $buttons['save'] = new OOUI\ButtonInputWidget( [ + 'id' => 'wpSaveWidget', + 'inputId' => 'wpSave', // Support: IE 6 – Use , otherwise it can't distinguish which button was clicked 'useInputTag' => true, 'flags' => [ 'constructive', 'primary' ], @@ -4354,20 +4354,20 @@ HTML } else { $buttons['save'] = Html::submitButton( $buttonLabel, - $attribs, + $attribs + [ 'id' => 'wpSave' ], [ 'mw-ui-progressive' ] ); } $attribs = [ - 'id' => 'wpPreviewWidget', - 'inputId' => 'wpPreview', 'name' => 'wpPreview', 'tabindex' => ++$tabindex, ] + Linker::tooltipAndAccesskeyAttribs( 'preview' ); if ( $this->oouiEnabled ) { $previewConfig = OOUI\Element::configFromHtmlAttributes( $attribs ); $buttons['preview'] = new OOUI\ButtonInputWidget( [ + 'id' => 'wpPreviewWidget', + 'inputId' => 'wpPreview', // Support: IE 6 – Use , otherwise it can't distinguish which button was clicked 'useInputTag' => true, 'label' => $this->context->msg( 'showpreview' )->text(), @@ -4377,18 +4377,18 @@ HTML } else { $buttons['preview'] = Html::submitButton( $this->context->msg( 'showpreview' )->text(), - $attribs + $attribs + [ 'id' => 'wpPreview' ] ); } $attribs = [ - 'id' => 'wpDiffWidget', - 'inputId' => 'wpDiff', 'name' => 'wpDiff', 'tabindex' => ++$tabindex, ] + Linker::tooltipAndAccesskeyAttribs( 'diff' ); if ( $this->oouiEnabled ) { $diffConfig = OOUI\Element::configFromHtmlAttributes( $attribs ); $buttons['diff'] = new OOUI\ButtonInputWidget( [ + 'id' => 'wpDiffWidget', + 'inputId' => 'wpDiff', // Support: IE 6 – Use , otherwise it can't distinguish which button was clicked 'useInputTag' => true, 'label' => $this->context->msg( 'showdiff' )->text(), @@ -4398,7 +4398,7 @@ HTML } else { $buttons['diff'] = Html::submitButton( $this->context->msg( 'showdiff' )->text(), - $attribs + $attribs + [ 'id' => 'wpDiff' ] ); } -- 2.20.1