This commit is contained in:
salam committed 2026-09-06 13:21:41 +02:00
1 parent 44784e1dd8
commit 20b3beb6a2
2 files changed
+6 -6

No files matched your search

+4 -5
View File
@@ -11,7 +11,7 @@ class BoardDispatcher extends Component
public array $results = []; 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 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 $boardVersion = '';
public bool $calculationDisabled = true; public string $copystring = '';
public bool $copyDisabled = true; public bool $copyDisabled = true;
public string $calculationColor = 'gray'; public string $calculationColor = 'gray';
public string $copyColor = 'gray'; public string $copyColor = 'gray';
@@ -79,11 +79,10 @@ class BoardDispatcher extends Component
public function copy() public function copy()
{ {
$str = ''; $this->copystring = '';
foreach ($this->results as $k => $row) { foreach ($this->results as $row) {
$str .= implode("\t", $row) . "\n"; $this->copystring .= implode("\t", $row) . "\n";
} }
$this->js("navigator.clipboard.writeText('{$str}')");
} }
@@ -23,7 +23,8 @@
<!-- Copy-Button --> <!-- Copy-Button -->
<x-filament::button icon="heroicon-o-clipboard-document-list" size="md" tooltip="Copy" <x-filament::button icon="heroicon-o-clipboard-document-list" size="md" tooltip="Copy"
:disabled="$copyDisabled" class="cursor-pointer" color="{{ $copyColor }}" x-on:click="$wire.copy()" /> :disabled="$copyDisabled" class="cursor-pointer" color="{{ $copyColor }}"
x-on:click="navigator.clipboard.writeText({{ $this->copystring }})" />
<!-- Calculate-Button --> <!-- Calculate-Button -->
<x-filament::button icon="heroicon-o-calculator" size="md" tooltip="Calculate" :disabled="$calculationDisabled" <x-filament::button icon="heroicon-o-calculator" size="md" tooltip="Calculate" :disabled="$calculationDisabled"