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

Change subject: zuul: Don't toggle panel when clicking Gerrit patch link
......................................................................


zuul: Don't toggle panel when clicking Gerrit patch link

Each patch set panel is clickable in its entirety. Clicks anywhere
on the header of the widget propagate to the wrapper element and
result in the panel being toggled.

This works as expected when clicking on non-interactive areas,
such as the title, ETA, background, or progress bar.

However, this doesn't work as expected when clicking on the
Gerrit patch link, which inadvertently also causes the panel
to be toggled.

Add logic to the click event handler to ignore the event if it
bubbled up from an anchor link.

Test Plan:
* 
http://localhost/integration-docroot/org/wikimedia/integration/zuul/?demo=basic 
or:
  /zuul/?source_url=https://integration.wikimedia.org/zuul/status.json
* Click on a Gerrit change link in the top part of a panel.

Previously, it triggers a panel toggle. Now it doesn't.
Clicking elsewhere still toggles the panel.

Change-Id: Ifadf3dfabfc361e1e7d775a62c4c2643b0e2b2c2
---
M zuul-status/public_html/jquery.zuul.js
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Hashar: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/zuul-status/public_html/jquery.zuul.js 
b/zuul-status/public_html/jquery.zuul.js
index 46c7785..d0a200b 100644
--- a/zuul-status/public_html/jquery.zuul.js
+++ b/zuul-status/public_html/jquery.zuul.js
@@ -542,6 +542,11 @@
                 // Toggle showing/hiding the patchset when the header is
                 // clicked.
 
+                if (e.target.nodeName.toLowerCase() === 'a') {
+                    // Ignore clicks from gerrit patch set link
+                    return;
+                }
+
                 // Grab the patchset panel
                 var $panel = $(e.target).parents('.zuul-change');
                 var $body = $panel.children('.zuul-patchset-body');

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifadf3dfabfc361e1e7d775a62c4c2643b0e2b2c2
Gerrit-PatchSet: 3
Gerrit-Project: integration/docroot
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Paladox <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to