Skip to content
Permalink
Browse files

[FIXED JENKINS-21613] combobox now recovers form.onsubmit to the one …

…just before override.
  • Loading branch information...
ikedam committed Feb 2, 2014
1 parent a30ada7 commit d0ff4135e9fbe86faf2caeb28c9e180b406eb6d1
Showing with 4 additions and 3 deletions.
  1. +4 −3 war/src/main/webapp/scripts/combobox.js
@@ -88,6 +88,7 @@ function ComboBox(idOrField, callback, config) {
alert("You have specified an invalid id for the field you want to turn into a combo box");
this.dropdown = document.createElement("div");
this.isDropdownShowing = false;
this.oldonsubmit = null;

// configure the dropdown div
this.dropdown.className = "comboBoxList";
@@ -111,11 +112,11 @@ function ComboBox(idOrField, callback, config) {
this.setSelectionRange(length, length);
}
}
this.field.form.oldonsubmit = this.field.form.onsubmit;
this.field.onfocus = function() {
this.comboBox.oldonsubmit = this.form.onsubmit;
this.form.onsubmit = function() {
if (self.isDropdownShowing) return false;
if (this.oldonsubmit) this.oldonsubmit();
if (self.oldonsubmit) self.oldonsubmit.call(this);
return true;
};
// repopulate and display the dropdown
@@ -124,7 +125,7 @@ function ComboBox(idOrField, callback, config) {
this.field.onblur = function() {
var cb = this.comboBox;
this.hideTimeout = setTimeout(function() { cb.hideDropdown(); }, 100);
this.form.onsubmit = this.form.oldonsubmit;
this.form.onsubmit = cb.oldonsubmit;
}

// privileged methods

0 comments on commit d0ff413

Please sign in to comment.
You can’t perform that action at this time.