v0.7.6 - Added snackbar
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
padding-right: 8px;
|
||||
}
|
||||
</style>
|
||||
<main>
|
||||
<main style="justify-content: unset;">
|
||||
@foreach(\App\News::query()->orderBy("created_at", "desc")->get() as $new)
|
||||
<div class="card">
|
||||
<div class="header">
|
||||
@@ -43,5 +43,31 @@
|
||||
@if(count(\App\News::query()->orderBy("created_at", "desc")->get()) == 0)
|
||||
<p class="text-center">{{__('msg.ingennyheder')}}</p>
|
||||
@endif
|
||||
<div id="snackbar">Some text some message..</div>
|
||||
</main>
|
||||
@endsection
|
||||
@section("scripts")
|
||||
<script type="text/javascript">
|
||||
function snackbar(data) {
|
||||
var x = document.getElementById("snackbar");
|
||||
x.innerHTML = data;
|
||||
x.className = "show";
|
||||
setTimeout(function(){ x.className = x.className.replace("show", ""); }, 3000);
|
||||
}
|
||||
|
||||
function ajaxCall(event_id) {
|
||||
axios.post("{{ route("userevents.createajax") }}",
|
||||
{
|
||||
event_id: event_id
|
||||
}
|
||||
).then(function (response) {
|
||||
var data = response.data;
|
||||
|
||||
snackbar(data);
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user