jenkins-bot has submitted this change and it was merged. Change subject: Also show the survey tooltip on click ......................................................................
Also show the survey tooltip on click To implement this, use PopupButtonWidget and override to handle hover in addition to click. Bug: T128937 Change-Id: I79f5bb5839491516b0a3f77630b481cd6c2cc3da (cherry picked from commit 732c8496f0bbf6a4724cac0d53dd137aad4acc56) --- M modules/ooui/mw.echo.ui.FooterNoticeWidget.js M modules/ooui/styles/mw.echo.ui.FooterNoticeWidget.less 2 files changed, 20 insertions(+), 6 deletions(-) Approvals: Dereckson: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/ooui/mw.echo.ui.FooterNoticeWidget.js b/modules/ooui/mw.echo.ui.FooterNoticeWidget.js index e34f2bc..f1633e1 100644 --- a/modules/ooui/mw.echo.ui.FooterNoticeWidget.js +++ b/modules/ooui/mw.echo.ui.FooterNoticeWidget.js @@ -11,7 +11,7 @@ * @cfg {string} [url] The URL for the survey */ mw.echo.ui.FooterNoticeWidget = function MwEchoUiFooterNoticeWidget( config ) { - var $icon, label, dismissButton, infoIcon, + var $icon, label, dismissButton, infoPopup, $row = $( '<div>' ) .addClass( 'mw-echo-ui-footerNoticeWidget-row' ); @@ -46,12 +46,25 @@ classes: [ 'mw-echo-ui-footerNoticeWidget-dismiss' ] } ); - infoIcon = new OO.ui.ButtonWidget( { - icon: 'help', + infoPopup = new OO.ui.PopupButtonWidget( { + classes: [ 'mw-echo-ui-footerNoticeWidget-info' ], framed: false, - title: mw.msg( 'echo-popup-footer-feedback-info' ), - classes: [ 'mw-echo-ui-footerNoticeWidget-info' ] + icon: 'help', + popup: { + align: 'backwards', + $content: $( '<p>' ).text( mw.msg( 'echo-popup-footer-feedback-info' ) ), + padded: true, + width: 450 + } } ); + infoPopup.$element.hover( + function () { + infoPopup.getPopup().toggle( true ); + }, + function () { + infoPopup.getPopup().toggle( false ); + } + ); // Events dismissButton.connect( this, { click: 'onDismissButtonClick' } ); @@ -62,7 +75,7 @@ $row .append( label.$element, - infoIcon.$element, + infoPopup.$element, dismissButton.$element ) ); diff --git a/modules/ooui/styles/mw.echo.ui.FooterNoticeWidget.less b/modules/ooui/styles/mw.echo.ui.FooterNoticeWidget.less index 4ce0fec..2bb3b61 100644 --- a/modules/ooui/styles/mw.echo.ui.FooterNoticeWidget.less +++ b/modules/ooui/styles/mw.echo.ui.FooterNoticeWidget.less @@ -4,6 +4,7 @@ .mw-echo-ui-footerNoticeWidget { padding: 0.5em; border-bottom: 1px solid #DDDDDD; + white-space: normal; &-row { display: table-row; -- To view, visit https://gerrit.wikimedia.org/r/282715 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79f5bb5839491516b0a3f77630b481cd6c2cc3da Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Echo Gerrit-Branch: wmf/1.27.0-wmf.20 Gerrit-Owner: Mattflaschen <mflasc...@wikimedia.org> Gerrit-Reviewer: Dereckson <dereck...@espace-win.org> Gerrit-Reviewer: Mattflaschen <mflasc...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits