From 20b3beb6a2b0621aabec0ae3ad0aa4ce3b821741 Mon Sep 17 00:00:00 2001 From: salam Date: Sun, 6 Sep 2026 13:21:41 +0200 Subject: [PATCH] wip --- app/Livewire/BoardDispatcher.php | 9 ++++----- resources/views/livewire/board-dispatcher.blade.php | 3 ++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Livewire/BoardDispatcher.php b/app/Livewire/BoardDispatcher.php index df22f89f..1a134d56 100644 --- a/app/Livewire/BoardDispatcher.php +++ b/app/Livewire/BoardDispatcher.php @@ -11,7 +11,7 @@ class BoardDispatcher extends Component public array $results = []; public array $destLabels = ['DR', 'MR', 'RW', 'DC', 'DM', 'MC', 'AM', 'SW', 'DC', 'DM', 'MC', 'AM', 'SM', 'ST', 'DC', 'DM', 'MC', 'AM', 'DL', 'ML', 'LM']; public string $boardVersion = ''; - public bool $calculationDisabled = true; + public string $copystring = ''; public bool $copyDisabled = true; public string $calculationColor = 'gray'; public string $copyColor = 'gray'; @@ -79,11 +79,10 @@ class BoardDispatcher extends Component public function copy() { - $str = ''; - foreach ($this->results as $k => $row) { - $str .= implode("\t", $row) . "\n"; + $this->copystring = ''; + foreach ($this->results as $row) { + $this->copystring .= implode("\t", $row) . "\n"; } - $this->js("navigator.clipboard.writeText('{$str}')"); } diff --git a/resources/views/livewire/board-dispatcher.blade.php b/resources/views/livewire/board-dispatcher.blade.php index a0094e6f..7f5506af 100644 --- a/resources/views/livewire/board-dispatcher.blade.php +++ b/resources/views/livewire/board-dispatcher.blade.php @@ -23,7 +23,8 @@ + :disabled="$copyDisabled" class="cursor-pointer" color="{{ $copyColor }}" + x-on:click="navigator.clipboard.writeText({{ $this->copystring }})" />