Skip to content

Commit 15b23c8

Browse files
committed
https://github.com/solutionforest/Filament-SimpleLightBox/issues/9
1 parent 372e4c6 commit 15b23c8

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/SimpleLightBoxPlugin.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,37 @@ public function boot(Panel $panel): void
2929
ImageColumn::macro('simpleLightbox', macro: function ($url = null) {
3030
$extraAttributes = $this->extraAttributes[0] ?? [];
3131
$extraImgAttributes = $this->extraImgAttributes[0] ?? [];
32-
3332
/** @phpstan-ignore-next-line */
3433
return $this
35-
->extraAttributes(array_merge($extraAttributes, ['x-on:click' => 'SimpleLightBox.open(event, \'' . $url . '\')']))
34+
->openUrlInNewTab()
35+
->extraAttributes(array_merge($extraAttributes, ['x-on:click' => 'SimpleLightBox.open(event, \''.$url.'\')']))
3636
->extraImgAttributes(array_merge($extraImgAttributes, ['class' => 'simple-light-box-img-indicator']));
3737
});
3838

3939
ImageEntry::macro('simpleLightbox', function ($url = null) {
4040
$extraAttributes = $this->extraAttributes[0] ?? [];
4141
$extraImgAttributes = $this->extraImgAttributes[0] ?? [];
42-
4342
/** @phpstan-ignore-next-line */
4443
return $this
44+
->openUrlInNewTab()
4545
->extraAttributes(array_merge($extraAttributes, ['x-on:click' => 'SimpleLightBox.open(event, \'' . $url . '\')']))
4646
->extraImgAttributes(array_merge($extraImgAttributes, ['class' => 'simple-light-box-img-indicator']));
4747
});
4848

4949
TextColumn::macro('simpleLightbox', function ($url) {
5050
$extraAttributes = $this->extraAttributes[0] ?? [];
51-
5251
/** @phpstan-ignore-next-line */
53-
return $this->extraAttributes(array_merge($extraAttributes, ['x-on:click' => 'SimpleLightBox.open(event, \'' . $url . '\')']));
52+
return $this
53+
->openUrlInNewTab()
54+
->extraAttributes(array_merge($extraAttributes,['x-on:click' => 'SimpleLightBox.open(event, \'' . $url . '\')']));
5455
});
5556

5657
TextEntry::macro('simpleLightbox', function ($url) {
5758
$extraAttributes = $this->extraAttributes[0] ?? [];
58-
5959
/** @phpstan-ignore-next-line */
60-
return $this->extraAttributes(array_merge($extraAttributes, ['x-on:click' => 'SimpleLightBox.open(event, \'' . $url . '\')']));
60+
return $this
61+
->openUrlInNewTab()
62+
->extraAttributes(array_merge($extraAttributes,['x-on:click' => 'SimpleLightBox.open(event, \'' . $url . '\')']));
6163
});
6264

6365
}

0 commit comments

Comments
 (0)