jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398274 )

Change subject: Make (get)HelpMessage optional in $.wikibase.edittoolbar.js
......................................................................


Make (get)HelpMessage optional in $.wikibase.edittoolbar.js

I decided to not make the getter optional, because this allows for a
more strict, clear interface. The getter is guaranteed to be there, it
just might not return anything.

Since calling the getter is derived, I went for hiding the empty question
mark icon after it was created. This should be the exceptional case
anyway. There is usually only 1 of these icons on a page anyway, so no
performance implications because of this.

Bug: T182890
Change-Id: I0c2bebafb163353362d8fb60c5d0c3fb588a4a4b
---
M view/resources/jquery/wikibase/toolbar/jquery.wikibase.edittoolbar.js
1 file changed, 5 insertions(+), 3 deletions(-)

Approvals:
  Lucas Werkmeister (WMDE): Looks good to me, approved
  jenkins-bot: Verified
  Thiemo Kreuz (WMDE): Looks good to me, approved



diff --git 
a/view/resources/jquery/wikibase/toolbar/jquery.wikibase.edittoolbar.js 
b/view/resources/jquery/wikibase/toolbar/jquery.wikibase.edittoolbar.js
index 3744418..0b0d771 100644
--- a/view/resources/jquery/wikibase/toolbar/jquery.wikibase.edittoolbar.js
+++ b/view/resources/jquery/wikibase/toolbar/jquery.wikibase.edittoolbar.js
@@ -317,9 +317,11 @@
                        // change their help messages anywhere in their 
lifecycle.
                        function addTooltip( helpMessage ) {
                                if ( self._$tooltipAnchor ) {
-                                       self._$tooltipAnchor.wbtooltip( {
-                                               content: helpMessage
-                                       } );
+                                       if ( helpMessage ) {
+                                               self._$tooltipAnchor.wbtooltip( 
{ content: helpMessage } );
+                                       } else {
+                                               self._$tooltipAnchor.hide();
+                                       }
                                }
                        }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/398274
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0c2bebafb163353362d8fb60c5d0c3fb588a4a4b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Thiemo Kreuz (WMDE) <[email protected]>
Gerrit-Reviewer: WMDE-leszek <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to