@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | $this->value = $this->value->toArray(); |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | - return collect((array) $this->value)->filter()->map(function ($path) use ($server, $width, $height, $expand) { |
|
| 17 | + return collect((array) $this->value)->filter()->map(function($path) use ($server, $width, $height, $expand) { |
|
| 18 | 18 | if (url()->isValidUrl($path)) { |
| 19 | 19 | $src = $path; |
| 20 | 20 | } elseif ($server) { |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | $src = Storage::disk(config('admin.upload.disk'))->url($path); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - if ($expand) Admin::script("$('img.img-expand').on('click', function() { $('.img-expanded').attr('src', $(this).attr('src')); $('#img-expand-" . $this->getKey() . "').modal('show'); });"); |
|
| 27 | - return ($expand?'<div class="modal fade" id="img-expand-' . $this->getKey() . '" tabindex="-1" role="dialog" aria-labelledby="img-expand" aria-hidden="true"><div class="modal-dialog modal-lg" role="document"><div class="modal-content"><div class="modal-body"><img src="" class="img-expanded" style="width: 100%;"></div></div></div></div>':'') . "<img src='$src' style='max-width:{$width}px;max-height:{$height}px' class='img img-thumbnail" . ($expand?' img-expand':'') . "' />"; |
|
| 26 | + if ($expand) Admin::script("$('img.img-expand').on('click', function() { $('.img-expanded').attr('src', $(this).attr('src')); $('#img-expand-".$this->getKey()."').modal('show'); });"); |
|
| 27 | + return ($expand ? '<div class="modal fade" id="img-expand-'.$this->getKey().'" tabindex="-1" role="dialog" aria-labelledby="img-expand" aria-hidden="true"><div class="modal-dialog modal-lg" role="document"><div class="modal-content"><div class="modal-body"><img src="" class="img-expanded" style="width: 100%;"></div></div></div></div>' : '')."<img src='$src' style='max-width:{$width}px;max-height:{$height}px' class='img img-thumbnail".($expand ? ' img-expand' : '')."' />"; |
|
| 28 | 28 | })->implode(' '); |
| 29 | 29 | } |
| 30 | 30 | } |
@@ -23,7 +23,9 @@ |
||
| 23 | 23 | $src = Storage::disk(config('admin.upload.disk'))->url($path); |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - if ($expand) Admin::script("$('img.img-expand').on('click', function() { $('.img-expanded').attr('src', $(this).attr('src')); $('#img-expand-" . $this->getKey() . "').modal('show'); });"); |
|
| 26 | + if ($expand) { |
|
| 27 | + Admin::script("$('img.img-expand').on('click', function() { $('.img-expanded').attr('src', $(this).attr('src')); $('#img-expand-" . $this->getKey() . "').modal('show'); });"); |
|
| 28 | + } |
|
| 27 | 29 | return ($expand?'<div class="modal fade" id="img-expand-' . $this->getKey() . '" tabindex="-1" role="dialog" aria-labelledby="img-expand" aria-hidden="true"><div class="modal-dialog modal-lg" role="document"><div class="modal-content"><div class="modal-body"><img src="" class="img-expanded" style="width: 100%;"></div></div></div></div>':'') . "<img src='$src' style='max-width:{$width}px;max-height:{$height}px' class='img img-thumbnail" . ($expand?' img-expand':'') . "' />"; |
| 28 | 30 | })->implode(' '); |
| 29 | 31 | } |