fix : enabled & disabling numbers are working
This commit is contained in:
parent
210c2baf4a
commit
3ac0fd8cdb
@ -735,3 +735,9 @@ button.ready-to-print {
|
||||
.limit-button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
.number-button button[disabled] {
|
||||
background-color: #cccccc; /* Gray background for disabled */
|
||||
color: #666666; /* Darker text for contrast */
|
||||
cursor: not-allowed; /* Cursor indicates disabled state */
|
||||
opacity: 0.6; /* Slightly transparent */
|
||||
}
|
||||
@ -287,22 +287,33 @@ export class TouchPadMenuComponent implements OnInit, OnDestroy {
|
||||
if (!this.actualRunners.has(number)) {
|
||||
return true;
|
||||
}
|
||||
// Allow all numbers for TAN when boxed
|
||||
// Disable if total amount limit reached
|
||||
if (this.totalAmountLimitReached) {
|
||||
return true;
|
||||
}
|
||||
// Allow all numbers for TAN when boxed, but disable selected numbers
|
||||
if (this.selectedLabel === 'TAN' && this.isBoxed) {
|
||||
return false;
|
||||
return this.selectedNumbers.includes(number);
|
||||
}
|
||||
// Allow selection for TAN, multi-leg, or two-group labels
|
||||
if (
|
||||
this.selectedLabel === 'TAN' ||
|
||||
this.multiLegLabels.includes(this.selectedLabel || '') ||
|
||||
this.twoGroupLabels.includes(this.selectedLabel || '')
|
||||
) {
|
||||
return false;
|
||||
// TAN (unboxed): Disable numbers already selected in the current group
|
||||
if (this.selectedLabel === 'TAN') {
|
||||
return this.tanGroups[this.tanGroupStage].includes(number);
|
||||
}
|
||||
// Disable if number is already selected or total amount limit reached
|
||||
return this.selectedNumbers.includes(number) || this.totalAmountLimitReached;
|
||||
// Multi-leg pools (TRE, MJP, JKP): Disable numbers already selected in the current leg
|
||||
if (this.multiLegLabels.includes(this.selectedLabel || '')) {
|
||||
return this.multiLegGroups[this.multiLegStage].includes(number);
|
||||
}
|
||||
|
||||
// Two-group pools (FOR, QUI): Disable numbers already selected in the current group
|
||||
if (this.twoGroupLabels.includes(this.selectedLabel || '')) {
|
||||
if (!this.isFirstGroupComplete) {
|
||||
return this.firstGroup.includes(number);
|
||||
} else {
|
||||
return this.secondGroup.includes(number);
|
||||
}
|
||||
}
|
||||
// Default case for WIN, SHP, THP, PLC, etc.: Disable if already selected
|
||||
return this.selectedNumbers.includes(number);
|
||||
}
|
||||
selectLabel(label: string) {
|
||||
if (this.totalAmountLimitReached || this.blockedLabels.has(label)) {
|
||||
this.showLimitPopup = true;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user