aboutsummaryrefslogtreecommitdiffstats
path: root/bugzillaBugTriage.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-01-13 00:21:24 +0100
committerMatěj Cepl <mcepl@redhat.com>2010-01-13 00:21:24 +0100
commit8a2ceeb47cb22a5bdc29e60973bebd87bfbe9dd6 (patch)
treedf9b78a5ac14c15172488b9e0690b5836c24f08f /bugzillaBugTriage.js
parent3bcce687eeac389760b96a6ba18a1e7ce74f7354 (diff)
downloadbugzilla-triage-8a2ceeb47cb22a5bdc29e60973bebd87bfbe9dd6.tar.gz
Better make right bubbling, rather than play with oldSubmit function.
Diffstat (limited to 'bugzillaBugTriage.js')
-rw-r--r--bugzillaBugTriage.js17
1 files changed, 7 insertions, 10 deletions
diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js
index f2252fc..d8f5d1d 100644
--- a/bugzillaBugTriage.js
+++ b/bugzillaBugTriage.js
@@ -538,10 +538,11 @@ BzPage.prototype.submitCallback = function(evt) {
if (jetpack.__parent__.navigator.onLine) {
var serForm = this.serializeForm(this.dok.forms.namedItem("changeform"));
console.log("serForm:\n"+serForm.toSource());
- options.oldSubmit();
} else {
var serForm = this.serializeForm(this.dok.forms.namedItem("changeform"));
myStorage.forms[this.bugNo] = serForm;
+ evt.stopPropagation();
+ evt.preventDefault();
}
};
@@ -1807,6 +1808,10 @@ function BzPage(doc) {
that.changeOwner(filterByRegexp(defAssigneeList, that.component).
toLowerCase());
},false);
+
+ // offline-capable submit
+ this.dok.forms.namedItem("changeform").
+ addEventListener('submit', this.submitCallback, true);
}
var callback = function (doc) {
@@ -1824,15 +1829,7 @@ var callback = function (doc) {
// call real submit function
this._submit();
}
-
-// capture the onsubmit event on all forms
-window.addEventListener('submit', newsubmit, true);
-
-// If a script calls someForm.submit(), the onsubmit event does not fire,
-// so we need to redefine the submit method of the HTMLFormElement class.
-HTMLFormElement.prototype._submit = HTMLFormElement.prototype.submit;
-HTMLFormElement.prototype.submit = newsubmit;
- */
+*/
var options = {};
options.matches = [