From fcca737f372432da3d9bdb3f3ec1ee0eac6abe69 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Fri, 5 Feb 2010 15:00:10 +0100 Subject: Unsuccesful attempt to make prompt cancellabling. --- bugzillaBugTriage.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js index e2b07aa..7ada462 100644 --- a/bugzillaBugTriage.js +++ b/bugzillaBugTriage.js @@ -1702,6 +1702,8 @@ BzPage.prototype.addLogRecord = function () { myStorage.logs[recKey] = rec; } jetpack.storage.simple.sync(); + } else if (comment === null) { + return null; } }; @@ -1907,7 +1909,13 @@ function BzPage(doc) { console.log("logSubmits = " + logSubmits); if (logSubmits) { this.dok.forms.namedItem("changeform").addEventListener("submit", - function () {that.addLogRecord();} + function (evt) { + if (that.addLogRecord() === null) { + // FIXME doesn't work ... still submitting' + evt.stopPropagation(); + evt.preventDefault(); + } + } ,false); var generateTimeSheetUI = this.dok.createElement("li"); -- cgit