Commit e79afb33 authored by Ruslan Kabalin's avatar Ruslan Kabalin Committed by Richard Mansfield
Browse files

Add browser check to upload form (bug #623648)

parent ba5fd5a6
......@@ -85,11 +85,14 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
}
});
}
if (self.config.submitbutton && $(self.id + '_uploadsubmit')) {
if (is_FF() && self.config.submitbutton && $(self.id + '_uploadsubmit')) {
connect(self.id + '_uploadsubmit', 'onclick', self.upload_submit);
}
else {
connect(self.id + '_userfile', 'onchange', self.upload_submit);
if ($(self.id + '_uploadsubmit')) {
removeElement(self.id + '_uploadsubmit');
}
}
}
......@@ -133,10 +136,7 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
'name':'userfile',
'size':40
}));
if (self.config.submitbutton && $(self.id + '_uploadsubmit')) {
connect(self.id + '_uploadsubmit', 'onclick', self.upload_submit);
}
else {
if (!$(self.id + '_uploadsubmit')) {
connect(self.id + '_userfile', 'onchange', self.upload_submit);
}
$(self.id + '_upload').value = 0;
......
......@@ -740,3 +740,10 @@ function keypressKeyCode(e) {
}
return 0;
}
function is_FF() {
if ( /Firefox|Gecko|Iceweasel/.test(navigator.userAgent)) {
return true;
}
return false;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment