Commit 8bb6d4d3 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge changes Ib2361b62,Iee75f89b

* changes:
  Bug 1874540: preventing filelist buttons to catch events from the form that contains them
  Bug 1874540: stop adding the edit file details if there is no button to edit file allowed
parents 7a04ee29 3b963a09
......@@ -906,8 +906,9 @@ var FileBrowser = (function($) {
}
if (!existed) {
var remove = $('<button>', {'class': 'btn btn-secondary btn-sm text-small button submit unselect',
'type': 'submit',
'name': self.id+'_unselect[' + id + ']',
'type': 'button',
'id': 'editcomposite_filebrowser_unselect_' + id,
'title': get_string('remove')});
remove.append(
$('<span>', {'class': 'icon icon-times icon-lg text-danger left'}),
......
......@@ -186,7 +186,8 @@
</div>
{* Edit form used when js is available *}
{if $edit <= 0}
{* we show edit buttons if one of this conditions is true $config.edit or $config.editmeta, see filelist.tpl *}
{if $edit <= 0 && ($config.edit || $config.editmeta)}
<table class="d-none">
<tbody id="{$prefix}_edit_placeholder">
{include file="artefact:file:form/editfile.tpl" prefix=$prefix groupinfo=$groupinfo colspan=$colspan}
......
......@@ -107,7 +107,7 @@
<td class="right s nowrap text-right">
<div class="btn-group">
{if $selectable && ($file->artefacttype != 'folder' || $selectfolders) && $publishable && !$file->isparent}
<button type="submit" class="btn btn-sm btn-secondary" name="{$prefix}_select[{$file->id}]" id="{$prefix}_select_{$file->id}" title="{str tag=select}">
<button type="button" class="btn btn-sm btn-secondary" name="{$prefix}_select[{$file->id}]" id="{$prefix}_select_{$file->id}" title="{str tag=select}">
<span class="icon icon-check icon-lg" role="presentation" aria-hidden="true"></span>
<span class="sr-only">{str tag=selectspecific section=artefact.file arg1=$displaytitle|escape:html|safe}</span>
</button>
......
......@@ -30,7 +30,7 @@
{/if}
</td>
<td class="text-right s">
<button id="{$prefix}_unselect_{$file->id}" name="{$prefix}_unselect[{$file->id}]" class="btn btn-secondary btn-sm text-small button submit unselect" title="{str tag=remove}">
<button id="{$prefix}_unselect_{$file->id}" name="{$prefix}_unselect[{$file->id}]" class="btn btn-secondary btn-sm text-small button submit unselect" title="{str tag=remove}" type="button">
<span class="icon icon-times icon-lg text-danger left" role="presentation" aria-hidden="true"></span>
<span>{str tag=remove}</span>
</button>
......
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