summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorTimo Tijhof <krinklemail@gmail.com>2017-09-19 19:46:09 +0100
committerDavid Shrewsbury <shrewsbury.dave@gmail.com>2017-09-19 14:53:02 -0400
commit0445c277eb193e2dbdefd82b488ba74bc43e9b1b (patch)
treef3243e9906a4bf98983b1866b98bb51db4ac654e /etc
parent9a2362d55a84e7510372434f5b8672e2f6a1fc87 (diff)
downloadzuul-0445c277eb193e2dbdefd82b488ba74bc43e9b1b.tar.gz
Status: Don't toggle panel when clicking patch link
Each patchset 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/zuul/etc/status/public_html/?demo=basic * Click on a Gerrit patch link (e.g. "10101,1") in a panel. Previously, it triggers a panel toggle. Now it doesn't. Clicking elsewhere still toggles the panel. Cherry-picked from: Ifadf3dfabfc361e1e7d775a62c4c2643b0e2b2c2 Change-Id: Ifadf3dfabfc361e1e7d775a62c4c2643b0e2b2c2
Diffstat (limited to 'etc')
-rw-r--r--etc/status/public_html/jquery.zuul.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/etc/status/public_html/jquery.zuul.js b/etc/status/public_html/jquery.zuul.js
index 55384af39..70e999ee7 100644
--- a/etc/status/public_html/jquery.zuul.js
+++ b/etc/status/public_html/jquery.zuul.js
@@ -569,6 +569,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');