Commit c464d87a authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Make upload submit button compulsory for FF but settable by forms too (see bug #623648)


Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent e79afb33
......@@ -70,6 +70,16 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
'value':0
}));
}
if (is_FF() && self.config.select && !$(self.id + '_uploadsubmit') && $(self.id + '_uploadsubmit_container')) {
var submitbutton = INPUT({
'class': 'submit',
'type': 'submit',
'name': self.id + '_uploadsubmit',
'value': get_string('upload')
});
appendChildNodes(self.id + '_uploadsubmit_container', submitbutton);
self.config.submitbutton = true;
}
self.upload_connectbuttons();
}
......@@ -85,7 +95,7 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
}
});
}
if (is_FF() && self.config.submitbutton && $(self.id + '_uploadsubmit')) {
if (self.config.submitbutton && $(self.id + '_uploadsubmit')) {
connect(self.id + '_uploadsubmit', 'onclick', self.upload_submit);
}
else {
......
......@@ -133,6 +133,7 @@ class PluginArtefactFile extends PluginArtefact {
'maxuploadsize',
'nametoolong',
'namefieldisrequired',
'upload',
'uploadingfiletofolder',
'youmustagreetothecopyrightnotice',
),
......
......@@ -63,7 +63,7 @@
</tr>
<tr class="uploadform">
<th></th>
<td>
<td id="{$prefix}_uploadsubmit_container">{* filebrowser.js may add a submit button in here even if config.submitbutton is off *}
{if $config.submitbutton}
<input type="submit" class="submit nojs-hidden-block" name="{$prefix}_uploadsubmit" id="{$prefix}_uploadsubmit" value="{str tag=upload section=artefact.file}" />
{/if}
......
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