Skip to content

Commit

Permalink
station input amends
Browse files Browse the repository at this point in the history
  • Loading branch information
rolorogan committed Jul 15, 2024
1 parent ce4d3e6 commit aa71f01
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/app/controller/tickets.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@
vm.fromEmpty = true;
} else {
vm.stationFromName = null;
// vm.postJSON.stationNames[0] = null;
vm.postJSON.stationNames[0] = null;
vm.stationFromReq = false; // set from to required to ensure selection is made from list
vm.fromEmpty = false;
}
Expand All @@ -1039,8 +1039,9 @@
// reset from station
function clearFromStation() {
$scope.$broadcast('angucomplete-alt:clearInput', 'stationFrom');
$scope.$broadcast('angucomplete-alt:clearInput', 'stationFromOOC');
vm.stationFromName = null;
vm.postJSON.stationNames = null;
vm.postJSON.stationNames[0] = null;
vm.stationFromReq = false; // set from station to not required
vm.stationFromNameOocZ5 = null; // clear zone 5 in county
vm.fromStationInfoZone = null;
Expand Down Expand Up @@ -1069,7 +1070,7 @@
vm.stationToReq = true;
}

if (vm.toStationText != null && vm.stationToName == null) {
if (vm.toStationText !== null && vm.stationToName === null) {
vm.stationToReq = true;
}
};
Expand All @@ -1078,7 +1079,7 @@
vm.stationToReqOOC = true;
vm.stationTo = function(selected) {
if (selected) {
vm.stationToName = selected.originalObject.name; // set To Station
vm.stationToName = selected.title; // set To Station
vm.postJSON.stationNames[1] = selected.originalObject.name;
vm.stationToTitle = selected.originalObject.name;
vm.stationToNameZone = selected.originalObject.zone;
Expand All @@ -1090,7 +1091,7 @@
vm.toEmpty = true;
} else {
vm.stationToName = null;
// vm.postJSON.stationNames[1] = null;
vm.postJSON.stationNames[1] = null;
vm.stationToTitle = null;
vm.toEmpty = false;
}
Expand All @@ -1099,12 +1100,14 @@
// reset to station
function clearToStation() {
$scope.$broadcast('angucomplete-alt:clearInput', 'stationTo');
vm.stationToName = null;
vm.postJSON.stationNames = null;
$scope.$broadcast('angucomplete-alt:clearInput', 'stationTo2');
$scope.$broadcast('angucomplete-alt:clearInput', 'stationTo3');
vm.stationToName = '';
vm.postJSON.stationNames[1] = null;
vm.stationToReq = false; // set to station to not required
vm.stationToNameOocZ5 = null; // clear zone 5 in county
vm.toStationInfoZone = null;
vm.toStationText = null;
vm.toStationText = '';
}

// via station
Expand Down

0 comments on commit aa71f01

Please sign in to comment.