Fix a nasty Internet Suxplorer bug which prevented XHR forms from being correctly submitted.
This commit is contained in:
parent
a5cb3b04cb
commit
f64847e2dd
1 changed files with 9 additions and 10 deletions
|
@ -195,22 +195,21 @@ function cbi_filebrowser(id, url, defpath) {
|
||||||
|
|
||||||
//Hijacks the CBI form to send via XHR (requires Prototype)
|
//Hijacks the CBI form to send via XHR (requires Prototype)
|
||||||
function cbi_hijack_forms(layer, win, fail, load) {
|
function cbi_hijack_forms(layer, win, fail, load) {
|
||||||
layer.select('form').each(function(form) {
|
var forms = layer.getElementsByTagName('form');
|
||||||
form.observe('submit', function(event) {
|
for (var i=0; i<forms.length; i++) {
|
||||||
|
$(forms[i]).observe('submit', function(event) {
|
||||||
// Prevent the form from also submitting the regular way
|
// Prevent the form from also submitting the regular way
|
||||||
event.stop();
|
event.stop();
|
||||||
|
|
||||||
var form = event.element();
|
// Submit via XHR
|
||||||
|
event.element().request({
|
||||||
|
onSuccess: win,
|
||||||
|
onFailure: fail
|
||||||
|
});
|
||||||
|
|
||||||
if (load) {
|
if (load) {
|
||||||
load();
|
load();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Submit via XHR
|
|
||||||
form.request({
|
|
||||||
onSuccess: win,
|
|
||||||
onFailure: fail
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue