fix(patents): prevent slider handles from crossing and reduce server requests on drag
LocationBasedServices/smartguide/pipeline/pr-dev There was a failure building this commit
LocationBasedServices/smartguide/pipeline/pr-dev There was a failure building this commit
This commit is contained in:
@@ -56,7 +56,7 @@
|
||||
[max]="maxYear"
|
||||
[value]="selectedStartYear"
|
||||
[style.z-index]="selectedStartYear >= selectedEndYear - 5 ? 4 : 2"
|
||||
(input)="onStartYearInput($event)"
|
||||
(change)="onStartYearInput($event)"
|
||||
aria-label="Startjahr" />
|
||||
<input
|
||||
class="range-input range-input-end"
|
||||
@@ -64,7 +64,7 @@
|
||||
[min]="minYear"
|
||||
[max]="maxYear"
|
||||
[value]="selectedEndYear"
|
||||
(input)="onEndYearInput($event)"
|
||||
(change)="onEndYearInput($event)"
|
||||
aria-label="Endjahr" />
|
||||
</div>
|
||||
|
||||
@@ -123,6 +123,7 @@
|
||||
<mat-card-footer>
|
||||
<mat-card-actions>
|
||||
<button
|
||||
type="button"
|
||||
mat-button
|
||||
(click)="openPatent(patent); $event.stopPropagation()">
|
||||
<mat-icon>info</mat-icon>
|
||||
|
||||
@@ -105,16 +105,18 @@ export class PatentsComponent implements OnInit {
|
||||
}
|
||||
|
||||
onStartYearInput(event: Event): void {
|
||||
const val = parseInt((event.target as HTMLInputElement).value, 10);
|
||||
this.selectedStartYear = Math.min(val, this.selectedEndYear);
|
||||
const input = event.target as HTMLInputElement;
|
||||
this.selectedStartYear = Math.min(parseInt(input.value, 10), this.selectedEndYear);
|
||||
input.value = String(this.selectedStartYear);
|
||||
this.page = 0;
|
||||
this.loadPatents();
|
||||
this.updateQueryParams();
|
||||
}
|
||||
|
||||
onEndYearInput(event: Event): void {
|
||||
const val = parseInt((event.target as HTMLInputElement).value, 10);
|
||||
this.selectedEndYear = Math.max(val, this.selectedStartYear);
|
||||
const input = event.target as HTMLInputElement;
|
||||
this.selectedEndYear = Math.max(parseInt(input.value, 10), this.selectedStartYear);
|
||||
input.value = String(this.selectedEndYear);
|
||||
this.page = 0;
|
||||
this.loadPatents();
|
||||
this.updateQueryParams();
|
||||
|
||||
Reference in New Issue
Block a user