column-modal.blade.php
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<span data-toggle="modal" data-target="#grid-modal-{{ $name }}" data-key="{{ $key }}">
<a href="javascript:void(0)"><i class="fa fa-clone"></i> {{ $value }}</a>
</span>
<div class="modal grid-modal fade" id="grid-modal-{{ $name }}" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content" style="border-radius: 5px;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">{{ $title }}</h4>
</div>
<div class="modal-body">
{!! $html !!}
</div>
</div>
</div>
</div>
@if($grid)
<style>
.box.grid-box {
box-shadow: none;
border-top: none;
}
.grid-box .box-header:first-child {
display: none;
}
</style>
@endif
@if($async)
<script>
var modal = $('#grid-modal-{{ $name }}');
var modalBody = modal.find('.modal-body');
var load = function (url) {
modalBody.html("<div class='loading text-center' style='height:200px;'>\
<i class='fa fa-spinner fa-pulse fa-3x fa-fw' style='margin-top: 80px;'></i>\
</div>");
$.get(url, function (data) {
modalBody.html(data);
});
};
modal.on('show.bs.modal', function (e) {
var key = $(e.relatedTarget).data('key');
load('{{ $url }}'+'&key='+key);
}).on('click', '.page-item a, .filter-box a', function (e) {
load($(this).attr('href'));
e.preventDefault();
}).on('submit', '.box-header form', function (e) {
load($(this).attr('action')+'&'+$(this).serialize());
return false;
});
</script>
@endif