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 {
|
.limit-button:hover {
|
||||||
background-color: #0056b3;
|
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)) {
|
if (!this.actualRunners.has(number)) {
|
||||||
return true;
|
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) {
|
if (this.selectedLabel === 'TAN' && this.isBoxed) {
|
||||||
return false;
|
return this.selectedNumbers.includes(number);
|
||||||
}
|
}
|
||||||
// Allow selection for TAN, multi-leg, or two-group labels
|
// TAN (unboxed): Disable numbers already selected in the current group
|
||||||
if (
|
if (this.selectedLabel === 'TAN') {
|
||||||
this.selectedLabel === 'TAN' ||
|
return this.tanGroups[this.tanGroupStage].includes(number);
|
||||||
this.multiLegLabels.includes(this.selectedLabel || '') ||
|
|
||||||
this.twoGroupLabels.includes(this.selectedLabel || '')
|
|
||||||
) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
// Disable if number is already selected or total amount limit reached
|
// Multi-leg pools (TRE, MJP, JKP): Disable numbers already selected in the current leg
|
||||||
return this.selectedNumbers.includes(number) || this.totalAmountLimitReached;
|
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) {
|
selectLabel(label: string) {
|
||||||
if (this.totalAmountLimitReached || this.blockedLabels.has(label)) {
|
if (this.totalAmountLimitReached || this.blockedLabels.has(label)) {
|
||||||
this.showLimitPopup = true;
|
this.showLimitPopup = true;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user