diff options
Diffstat (limited to 'bugzillaBugTriage.js')
-rw-r--r-- | bugzillaBugTriage.js | 17 |
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 = [ |