Commit abad52a 1 parent 34c5b0a commit abad52a Copy full SHA for abad52a
File tree 2 files changed +18
-21
lines changed
2 files changed +18
-21
lines changed Original file line number Diff line number Diff line change @@ -21,21 +21,20 @@ protected function setUp(): void
21
21
->color ('gray ' )
22
22
->url (url ()->current ())
23
23
->icon ('heroicon-o-clipboard-document ' )
24
- ->link ()
25
- // ->extraAttributes([
26
- // 'x-data' => '',
27
- // 'x-on:click' => new HtmlString('
28
- // const filamentContextMenuTextToCopy = window.getSelection().toString();
29
- // navigator.clipboard.writeText(filamentContextMenuTextToCopy).then(
30
- // () => {
31
- // console.log("Text copied to clipboard");
32
- // },
33
- // (err) => {
34
- // console.error("Failed to copy text: ", err);
35
- // }
36
- // );
37
- // '),
38
- // ])
39
- ;
24
+ ->link ();
25
+ // ->extraAttributes([
26
+ // 'x-data' => '',
27
+ // 'x-on:click' => new HtmlString('
28
+ // const filamentContextMenuTextToCopy = window.getSelection().toString();
29
+ // navigator.clipboard.writeText(filamentContextMenuTextToCopy).then(
30
+ // () => {
31
+ // console.log("Text copied to clipboard");
32
+ // },
33
+ // (err) => {
34
+ // console.error("Failed to copy text: ", err);
35
+ // }
36
+ // );
37
+ // '),
38
+ // ])
40
39
}
41
40
}
Original file line number Diff line number Diff line change 2
2
3
3
namespace AymanAlhattami \FilamentContextMenu ;
4
4
5
- use Closure ;
6
5
use Filament \Actions \Action ;
7
- use Filament \Actions \ActionGroup ;
8
6
use InvalidArgumentException ;
9
7
10
8
trait InteractsWithContextMenuActions
@@ -20,11 +18,11 @@ protected function cacheContextMenuActions(): void
20
18
{
21
19
foreach ($ this ->getContextMenuActions () as $ action ) {
22
20
23
- if (!$ action instanceof Action and !$ action instanceof ContextMenuDivider) {
21
+ if (! $ action instanceof Action and ! $ action instanceof ContextMenuDivider) {
24
22
throw new InvalidArgumentException ('context menu action must be an instance of ' . Action::class . '. ' );
25
23
}
26
24
27
- if ($ action instanceof Action) {
25
+ if ($ action instanceof Action) {
28
26
$ this ->cacheAction ($ action );
29
27
$ this ->cachedContextMenuActions [] = $ action ;
30
28
}
@@ -36,7 +34,7 @@ public function getCachedContextMenuActions(): array
36
34
return $ this ->cachedContextMenuActions ;
37
35
}
38
36
39
- public function getContextMenu () : ContextMenu
37
+ public function getContextMenu (): ContextMenu
40
38
{
41
39
return ContextMenu::make ()->actions ($ this ->getCachedContextMenuActions ());
42
40
}
You can’t perform that action at this time.
0 commit comments