aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-05-26 01:31:12 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-05-26 01:31:12 +0200
commit42d700237558058eae8267ee91d95e46083fc9be (patch)
tree312a7e58030fed99e089f1319fdf54428c8bb567
parent5dd666ee89fb0511148972c1f6e65ce597ede5d4 (diff)
downloadbugzilla-triage-42d700237558058eae8267ee91d95e46083fc9be.tar.gz
Finally! Cancel in the comment dialog box avoids submit.
-rw-r--r--bugzillaBugTriage.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js
index dcb6130..619ed33 100644
--- a/bugzillaBugTriage.js
+++ b/bugzillaBugTriage.js
@@ -654,8 +654,9 @@ Logger.prototype.addLogRecord = function(that) {
rec.url = that.doc.location.toString();
rec.title = that.title;
let comment = jetpack.tabs.focused.contentWindow.prompt(
- "Enter comments for this comment").trim();
- if (comment.length > 0) {
+ "Enter comments for this comment");
+ if (comment && comment.length > 0) {
+ comment = comment.trim();
console.log("comment = " + comment);
console.log("");
rec.comment = comment;
@@ -1424,7 +1425,9 @@ BZPage.prototype.setUpLogging = function() {
console.log("Installing submit callback!");
this.doc.forms.namedItem("changeform").addEventListener("submit",function (evt) {
console.log("Submit callback!");
- if (that.log.addLogRecord(that) === null) {
+ let resp = that.log.addLogRecord(that);
+ console.log("resp = " + resp);
+ if (resp === null) {
console.log("Avoiding submitting!");
// FIXME doesn't work ... still submitting'
evt.stopPropagation();