Commit 14f94bba authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Hide select button on files that are already seleted

parent fc96a151
......@@ -349,6 +349,10 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
this.connect_select_buttons = function () {
forEach(getElementsByTagAndClassName('button', 'select', 'filelist'), function (elem) {
var id = elem.name.replace(/.*_select\[(\d+)\]$/, '$1');
if (self.selecteddata[id]) {
addElementClass(elem, 'hidden');
}
connect(elem, 'onclick', function (e) {
e.stop();
var id = this.name.replace(/.*_select\[(\d+)\]$/, '$1');
......@@ -392,6 +396,9 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
'title': self.filedata[id].title,
'description': self.filedata[id].description
};
if ($(self.id + '_select_' + id)) {
addElementClass(self.id + '_select_' + id, 'hidden');
}
if (self.filedata[id].tags) {
self.selecteddata[id].tags = self.filedata[id].tags;
}
......@@ -413,6 +420,9 @@ function FileBrowser(idprefix, folderid, config, globalconfig) {
setNodeAttribute(rows[r], 'class', 'r' + r % 2);
}
}
if ($(self.id + '_select_' + id)) {
removeElementClass(self.id + '_select_' + id, 'hidden');
}
return false;
}
......
......@@ -40,7 +40,7 @@
{if $file->childcount == 0}<button type="submit" name="{$prefix}_delete[{$file->id}]" value="{$file->id}">{str tag=delete}</button>{/if}
{/if}
{if $selectable && $file->artefacttype != 'folder'}
<button type="submit" class="select small" name="{$prefix}_select[{$file->id}]" value="{$file->id}">{str tag=select}</button>
<button type="submit" class="select small" name="{$prefix}_select[{$file->id}]" id="{$prefix}_select_{$file->id}" value="{$file->id}">{str tag=select}</button>
{/if}
</td>
</tr>
......
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