aboutsummaryrefslogtreecommitdiffstats
path: root/web/cobrands/zurich/js.js
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2016-10-18 13:35:51 +0100
committerDave Arter <davea@mysociety.org>2016-10-18 13:35:51 +0100
commit95806201712d53f76a94509f46a87ec76a0f7c98 (patch)
treed3fa3c9158cbe20165d163801200a4c65ecb1d3d /web/cobrands/zurich/js.js
parentfbe159d78ce133cadf79645660f49ddf7bfbc569 (diff)
[Zurich] Fix bug on image thumbnail in admin
Clicking the thumbnail on a report admin page was causing the 'rotating photo will discard changes' alert to appear unnecessarily. This was due to the data-confirm attribute on the parent <dd>, the meaning of which was changed by f5b171f. Fixed by using a different attribute name. Spotted another bug that I think caused the dialog to never actually be shown with the correct message because 'this' was the form and not the clicked button element.
Diffstat (limited to 'web/cobrands/zurich/js.js')
-rw-r--r--web/cobrands/zurich/js.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/web/cobrands/zurich/js.js b/web/cobrands/zurich/js.js
index d895789f1..f3977161c 100644
--- a/web/cobrands/zurich/js.js
+++ b/web/cobrands/zurich/js.js
@@ -122,7 +122,7 @@ $(function() {
// If the user has clicked to rotate a photo and has edited other
// fields, ask for confirmation before submitting the form
if (/rotate_photo/.test(clicked) && form_fields_changed) {
- var message = $(this).parent().data('confirm');
+ var message = $(this).find("input[name="+clicked+"]").parent().data('confirmMsg');
if (!confirm(message)) {
return false;
}