aligned "Neu" button with datatables search field
This commit is contained in:
parent
75984984dd
commit
ad6af25a48
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
{% block title %}Texte{% endblock title %}
|
{% block title %}Texte{% endblock title %}
|
||||||
|
|
||||||
{% block script %}<script>
|
{% block script %}
|
||||||
|
<script>
|
||||||
const SCRIPT_ROOT = {{ request.script_root | tojson }};
|
const SCRIPT_ROOT = {{ request.script_root | tojson }};
|
||||||
const textValues = ["Titel", "Untertitel"];
|
const textValues = ["Titel", "Untertitel"];
|
||||||
const selectValues = ["Reihe", "Textform", "Sprache"];
|
const selectValues = ["Reihe", "Textform", "Sprache"];
|
||||||
@ -51,18 +52,26 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
// add event listeners
|
|
||||||
document.getElementById ("create-button").addEventListener("click", showCreateModal, false);
|
|
||||||
for (const el of document.querySelectorAll('.action-update') ) {
|
|
||||||
el.addEventListener("click", showUpdateModal, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// initialise DataTable
|
// initialise DataTable
|
||||||
let table = new DataTable('#text-table', {
|
let table = new DataTable('#text-table', {
|
||||||
paging: false,
|
paging: false,
|
||||||
order: []
|
order: []
|
||||||
});
|
});
|
||||||
deRole("#text-table");
|
deRole("#text-table");
|
||||||
|
|
||||||
|
// create and append "New"-button to
|
||||||
|
let button = document.createElement("button");
|
||||||
|
button.id = "create-button";
|
||||||
|
button.setAttribute("title", "Text hinzufügen");
|
||||||
|
button.innerHTML = "Neu …";
|
||||||
|
button.addEventListener("click", showCreateModal, false);
|
||||||
|
document.getElementById("text-table_wrapper").firstElementChild.firstElementChild.appendChild(button);
|
||||||
|
|
||||||
|
// add event listeners
|
||||||
|
document.getElementById ("create-button").addEventListener("click", showCreateModal, false);
|
||||||
|
for (const el of document.querySelectorAll('.action-update') ) {
|
||||||
|
el.addEventListener("click", showUpdateModal, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>{% endblock script %}
|
</script>{% endblock script %}
|
||||||
|
|
||||||
@ -72,13 +81,6 @@
|
|||||||
|
|
||||||
{% include "_icons.svg" %}
|
{% include "_icons.svg" %}
|
||||||
|
|
||||||
<section>
|
|
||||||
<button id="create-button" onclick="showCreateModal()" title="Text hinzufügen">
|
|
||||||
<!-- <svg viewbox="0 0 24 24"><use href="#create" /></svg> -->
|
|
||||||
Neu …
|
|
||||||
</button>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<table id="text-table">
|
<table id="text-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
{% block title %}Werke{% endblock title %}
|
{% block title %}Werke{% endblock title %}
|
||||||
|
|
||||||
{% block script %}<script>
|
{% block script %}
|
||||||
|
<script>
|
||||||
const SCRIPT_ROOT = {{ request.script_root | tojson }};
|
const SCRIPT_ROOT = {{ request.script_root | tojson }};
|
||||||
const textValues = ["Titel", "Untertitel", "Reihennummer", "Erscheinungsdatum", "ISBN_13", "ISBN_10", "ISSN", "Preis", "Klappentext", "Anmerkungen"];
|
const textValues = ["Titel", "Untertitel", "Reihennummer", "Erscheinungsdatum", "ISBN_13", "ISBN_10", "ISSN", "Preis", "Klappentext", "Anmerkungen"];
|
||||||
const selectValues = ["Werksform", "Verlag", "Reihe"];
|
const selectValues = ["Werksform", "Verlag", "Reihe"];
|
||||||
@ -55,20 +56,28 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
// add event listeners
|
|
||||||
document.getElementById ("create-button").addEventListener("click", showCreateModal, false);
|
|
||||||
for (const el of document.querySelectorAll('.action-update') ) {
|
|
||||||
el.addEventListener("click", showUpdateModal, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// initialise DataTable
|
// initialise DataTable
|
||||||
let table = new DataTable('#werk-table', {
|
let table = new DataTable('#werk-table', {
|
||||||
paging: false,
|
paging: false,
|
||||||
order: []
|
order: []
|
||||||
});
|
});
|
||||||
deRole("#werk-table");
|
deRole("#werk-table");
|
||||||
|
|
||||||
|
// create and append "New"-button to
|
||||||
|
let button = document.createElement("button");
|
||||||
|
button.id = "create-button";
|
||||||
|
button.setAttribute("title", "Werk hinzufügen");
|
||||||
|
button.innerHTML = "Neu …";
|
||||||
|
button.addEventListener("click", showCreateModal, false);
|
||||||
|
document.getElementById("werk-table_wrapper").firstElementChild.firstElementChild.appendChild(button);
|
||||||
|
|
||||||
|
// add event listeners
|
||||||
|
for (const el of document.querySelectorAll('.action-update') ) {
|
||||||
|
el.addEventListener("click", showUpdateModal, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>{% endblock script %}
|
</script>
|
||||||
|
{% endblock script %}
|
||||||
|
|
||||||
{% block heading %}Werke{% endblock heading %}
|
{% block heading %}Werke{% endblock heading %}
|
||||||
|
|
||||||
@ -76,13 +85,6 @@
|
|||||||
|
|
||||||
{% include "_icons.svg" %}
|
{% include "_icons.svg" %}
|
||||||
|
|
||||||
<section>
|
|
||||||
<button id="create-button" href="#" title="Werk hinzufügen">
|
|
||||||
<!-- <svg viewbox="0 0 24 24"><use href="#create" /></svg> -->
|
|
||||||
Neu …
|
|
||||||
</button>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<table id="werk-table">
|
<table id="werk-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user