diff --git a/app/Livewire/BoardDispatcher.php b/app/Livewire/BoardDispatcher.php
index 11cb8f46..0ad0611e 100644
--- a/app/Livewire/BoardDispatcher.php
+++ b/app/Livewire/BoardDispatcher.php
@@ -11,7 +11,6 @@ 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 string $copystring = '';
public bool $copyDisabled = true;
public bool $calculationDisabled = true;
public string $calculationColor = 'gray';
@@ -77,12 +76,13 @@ class BoardDispatcher extends Component
$this->setCopyButton();
}
- public function copy()
+ public function copyResult()
{
- $this->copystring = '';
+ $copystring = '';
foreach ($this->results as $row) {
- $this->copystring .= implode("\t", $row) . "\n";
+ $copystring .= implode("\t", $row) . "\n";
}
+ $this->js("navigator.clipboard.writeText('{$copystring}')");
}
diff --git a/resources/views/livewire/board-dispatcher.blade.php b/resources/views/livewire/board-dispatcher.blade.php
index 7f5506af..9c7ab694 100644
--- a/resources/views/livewire/board-dispatcher.blade.php
+++ b/resources/views/livewire/board-dispatcher.blade.php
@@ -23,8 +23,7 @@
+ :disabled="$copyDisabled" class="cursor-pointer" color="{{ $copyColor }}" x-on:click="$wire.copyResult()" />