got rid of dummy data in modal template
This commit is contained in:
parent
c8fac05974
commit
35933ebc56
@ -40,7 +40,7 @@
|
|||||||
^{modal ".toggler1" Nothing}
|
^{modal ".toggler1" Nothing}
|
||||||
<a href="/" .btn.toggler1>Klick mich für Ajax-Test
|
<a href="/" .btn.toggler1>Klick mich für Ajax-Test
|
||||||
<noscript>(Für Modals bitte JS aktivieren)</noscript>
|
<noscript>(Für Modals bitte JS aktivieren)</noscript>
|
||||||
^{modal ".toggler2" (Just "Test wegen Modal")}
|
^{modal ".toggler2" (Just "Test Inhalt für Modal")}
|
||||||
<div .btn.toggler2>Klick mich für Content-Test
|
<div .btn.toggler2>Klick mich für Content-Test
|
||||||
<noscript>(Für Modals bitte JS aktivieren)</noscript>
|
<noscript>(Für Modals bitte JS aktivieren)</noscript>
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,8 @@
|
|||||||
var origParent = modal.parentNode;
|
var origParent = modal.parentNode;
|
||||||
|
|
||||||
function open(event) {
|
function open(event) {
|
||||||
|
// disable modals for narrow screens
|
||||||
|
if (window.innerWidth < 768) return true;
|
||||||
if (event) {
|
if (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
@ -64,7 +66,9 @@
|
|||||||
replaceMe.classList.remove('replace-me');
|
replaceMe.classList.remove('replace-me');
|
||||||
replaceMe.innerText = '...loading';
|
replaceMe.innerText = '...loading';
|
||||||
if (replaceWith.length > 0) {
|
if (replaceWith.length > 0) {
|
||||||
fetch(replaceWith).then(function(response) {
|
fetch(replaceWith, {
|
||||||
|
credentials: 'same-origin'
|
||||||
|
}).then(function(response) {
|
||||||
return response.text();
|
return response.text();
|
||||||
}).then(function(body) {
|
}).then(function(body) {
|
||||||
var modalContent = document.createElement('div');
|
var modalContent = document.createElement('div');
|
||||||
|
|||||||
@ -1,18 +1,8 @@
|
|||||||
<div .modal.js-modal #modal-#{modalId} data-trigger=#{modalTrigger} data-closeable=true>
|
<div .modal.js-modal #modal-#{modalId} data-trigger=#{modalTrigger} data-closeable=true>
|
||||||
|
$# primitive way of checking if this is supposed to be add a placeholder for async data.
|
||||||
|
$# modalContent is 'placeholder' if there should be a placeholder only.
|
||||||
|
$# 'placeholder' has length 11.
|
||||||
$if 11 == length modalContent
|
$if 11 == length modalContent
|
||||||
<div .replace-me>
|
<div .replace-me>
|
||||||
$else
|
$else
|
||||||
<h2>Neue Veranstaltung
|
|
||||||
#{modalContent}
|
#{modalContent}
|
||||||
<form>
|
|
||||||
<div .form-group>
|
|
||||||
<label .reactive-label for="inp1">Name
|
|
||||||
<input type="text" id="inp1">
|
|
||||||
<div .form-group>
|
|
||||||
<label .reactive-label for="inp2">Kürzel
|
|
||||||
<input type="text" id="inp2">
|
|
||||||
<div .form-group>
|
|
||||||
<label .reactive-label for="inp3">Semester
|
|
||||||
<input type="text" id="inp3">
|
|
||||||
<div .form-group>
|
|
||||||
<input type="submit" value="Submit">
|
|
||||||
|
|||||||
Reference in New Issue
Block a user