Commit 0d0bf422 authored by Nigel McNie's avatar Nigel McNie
Browse files

Prevent more than one tag control appearing for the 'create folder' form -...

Prevent more than one tag control appearing for the 'create folder' form - basically the same fix as for 144adb0a.

Don't do it by IDs however, because on the My Files page both tag inputs have the same ID. That will only end in pain. So for now, back to .parentNode hacks.
parent 2442c6bd
......@@ -310,7 +310,7 @@ function FileBrowser(element, source, statevars, changedircallback, actionname,
$(formid).name.value = '';
$(formid).description.value = '';
swapDOM($(formid).tags.parentNode.parentNode.parentNode.parentNode, create_tags_control('tags'));
swapDOM($(formid).tags.parentNode.parentNode.parentNode.parentNode.parentNode, create_tags_control('tags'));
$(formid+'message').innerHTML = '';
......@@ -534,7 +534,7 @@ function FileUploader(element, uploadscript, statevars, foldername, folderid, up
self.form.userfile.value = '';
self.form.title.value = '';
self.form.description.value = '';
swapDOM('tagcontrol-tags', create_tags_control('tags'));
swapDOM(self.form.tags.parentNode.parentNode.parentNode.parentNode.parentNode, create_tags_control('tags'));
......@@ -589,7 +589,7 @@ function create_tags_control(name, value, options) {
elements.push(augment_tags_control(tagControl, true));
elements.push(TABLE({'class': 'help-wrapper'}, TBODY(null, TR(null, TD(null, tagControl), TD({'class': 'helpcontainer'}, tagshelp)))));
return DIV({'id': 'tagcontrol-' + name}, elements);
return DIV(null, elements);
// this function takes an existing input element and augments it
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