Overflights implementation
This commit is contained in:
@@ -193,6 +193,8 @@ function createLookup(fieldId, resultsId, selectCallback, options = {}) {
|
||||
typeFieldId = 'local_type';
|
||||
} else if (fieldId === 'book_in_registration') {
|
||||
typeFieldId = 'book_in_type';
|
||||
} else if (fieldId === 'overflight_registration') {
|
||||
typeFieldId = 'overflight_type';
|
||||
}
|
||||
|
||||
if (typeFieldId) {
|
||||
@@ -360,6 +362,30 @@ function initializeLookups() {
|
||||
{ isAirport: true, minLength: 2 }
|
||||
);
|
||||
lookupManager.register('book-in-arrival-airport', bookInArrivalAirportLookup);
|
||||
|
||||
const overflightAircraftLookup = createLookup(
|
||||
'overflight_registration',
|
||||
'overflight-aircraft-lookup-results',
|
||||
null,
|
||||
{ isAircraft: true, minLength: 4, debounceMs: 300 }
|
||||
);
|
||||
lookupManager.register('overflight-aircraft', overflightAircraftLookup);
|
||||
|
||||
const overflightDepartureLookup = createLookup(
|
||||
'overflight_departure_airfield',
|
||||
'overflight-departure-airport-lookup-results',
|
||||
null,
|
||||
{ isAirport: true, minLength: 2 }
|
||||
);
|
||||
lookupManager.register('overflight-departure', overflightDepartureLookup);
|
||||
|
||||
const overflightDestinationLookup = createLookup(
|
||||
'overflight_destination_airfield',
|
||||
'overflight-destination-airport-lookup-results',
|
||||
null,
|
||||
{ isAirport: true, minLength: 2 }
|
||||
);
|
||||
lookupManager.register('overflight-destination', overflightDestinationLookup);
|
||||
|
||||
// Attach keyboard handlers to airport input fields
|
||||
setTimeout(() => {
|
||||
@@ -367,6 +393,8 @@ function initializeLookups() {
|
||||
if (departureAirportLookup.attachKeyboardHandler) departureAirportLookup.attachKeyboardHandler();
|
||||
if (localOutToLookup.attachKeyboardHandler) localOutToLookup.attachKeyboardHandler();
|
||||
if (bookInArrivalAirportLookup.attachKeyboardHandler) bookInArrivalAirportLookup.attachKeyboardHandler();
|
||||
if (overflightDepartureLookup.attachKeyboardHandler) overflightDepartureLookup.attachKeyboardHandler();
|
||||
if (overflightDestinationLookup.attachKeyboardHandler) overflightDestinationLookup.attachKeyboardHandler();
|
||||
}, 100);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user