mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-26 03:14:19 +00:00
update clickable list item
This commit is contained in:
parent
4944d31dd5
commit
9ffc41a133
@ -32,7 +32,7 @@ class CorpusFileList extends ResourceList {
|
|||||||
get item() {
|
get item() {
|
||||||
return (values) => {
|
return (values) => {
|
||||||
return `
|
return `
|
||||||
<tr class="list-item">
|
<tr class="list-item clickable hoverable">
|
||||||
<td>
|
<td>
|
||||||
<label class="list-action-trigger ${this.hasPermissionView ? '' : 'hide'}" data-list-action="select">
|
<label class="list-action-trigger ${this.hasPermissionView ? '' : 'hide'}" data-list-action="select">
|
||||||
<input class="select-checkbox" type="checkbox">
|
<input class="select-checkbox" type="checkbox">
|
||||||
@ -79,7 +79,7 @@ class CorpusFileList extends ResourceList {
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
<label class="selection-action-trigger ${this.listContainerElement.dataset?.hasPermissionView == 'true' ? '' : 'hide'}" data-selection-action="select-all">
|
<label class="disable-on-click selection-action-trigger ${this.listContainerElement.dataset?.hasPermissionView == 'true' ? '' : 'hide'}" data-selection-action="select-all">
|
||||||
<input class="select-all-checkbox" type="checkbox">
|
<input class="select-all-checkbox" type="checkbox">
|
||||||
<span class="disable-on-click"></span>
|
<span class="disable-on-click"></span>
|
||||||
</label>
|
</label>
|
||||||
@ -121,7 +121,7 @@ class CorpusFileList extends ResourceList {
|
|||||||
if (listItemElement === null) {return;}
|
if (listItemElement === null) {return;}
|
||||||
let itemId = listItemElement.dataset.id;
|
let itemId = listItemElement.dataset.id;
|
||||||
let listActionElement = event.target.closest('.list-action-trigger[data-list-action]');
|
let listActionElement = event.target.closest('.list-action-trigger[data-list-action]');
|
||||||
let listAction = listActionElement === null ? '' : listActionElement.dataset.listAction;
|
let listAction = listActionElement === null ? 'view' : listActionElement.dataset.listAction;
|
||||||
switch (listAction) {
|
switch (listAction) {
|
||||||
case 'delete': {
|
case 'delete': {
|
||||||
let values = this.listjs.get('id', itemId)[0].values();
|
let values = this.listjs.get('id', itemId)[0].values();
|
||||||
|
@ -63,7 +63,7 @@ class CorpusList extends ResourceList {
|
|||||||
get item() {
|
get item() {
|
||||||
return (values) => {
|
return (values) => {
|
||||||
return `
|
return `
|
||||||
<tr class="list-item">
|
<tr class="list-item clickable hoverable">
|
||||||
<td>
|
<td>
|
||||||
<label class="list-action-trigger" data-list-action="select">
|
<label class="list-action-trigger" data-list-action="select">
|
||||||
<input class="select-checkbox" type="checkbox">
|
<input class="select-checkbox" type="checkbox">
|
||||||
@ -143,7 +143,7 @@ class CorpusList extends ResourceList {
|
|||||||
if (listItemElement === null) {return;}
|
if (listItemElement === null) {return;}
|
||||||
let itemId = listItemElement.dataset.id;
|
let itemId = listItemElement.dataset.id;
|
||||||
let listActionElement = event.target.closest('.list-action-trigger[data-list-action]');
|
let listActionElement = event.target.closest('.list-action-trigger[data-list-action]');
|
||||||
let listAction = listActionElement === null ? '' : listActionElement.dataset.listAction;
|
let listAction = listActionElement === null ? 'view' : listActionElement.dataset.listAction;
|
||||||
switch (listAction) {
|
switch (listAction) {
|
||||||
case 'delete-request': {
|
case 'delete-request': {
|
||||||
let values = this.listjs.get('id', itemId)[0].values();
|
let values = this.listjs.get('id', itemId)[0].values();
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
<div class="col s12" id="user-corpora">
|
<div class="col s12" id="user-corpora">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
<div class="corpus-list no-autoinit" data-user-id="{{ user.hashid }}"></div>
|
<div class="corpus-list" data-user-id="{{ user.hashid }}"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -107,16 +107,6 @@
|
|||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
let corpusList = new CorpusList(document.querySelector('.corpus-list'));
|
|
||||||
corpusList.add(
|
|
||||||
[
|
|
||||||
{% for corpus in corpora %}
|
|
||||||
{{ corpus.to_json_serializeable(backrefs=True, relationships=True)|tojson }},
|
|
||||||
{% endfor %}
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
let userRoleChip = document.querySelector('#user-role-chip');
|
let userRoleChip = document.querySelector('#user-role-chip');
|
||||||
let userRoleChipTooltip = M.Tooltip.init(
|
let userRoleChipTooltip = M.Tooltip.init(
|
||||||
userRoleChip,
|
userRoleChip,
|
||||||
|
Loading…
Reference in New Issue
Block a user