add 'show all trains' toggle
This commit is contained in:
@ -23,6 +23,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="prefHeader">TRAINS</div>
|
<div id="prefHeader">TRAINS</div>
|
||||||
<div class="container-fluid" @change="decideShowTrains();">
|
<div class="container-fluid" @change="decideShowTrains();">
|
||||||
|
<div class="form-check form-switch">
|
||||||
|
<input @change="selectAllTrains();" class="form-check-input" type="checkbox" role="switch" id="showAllTrains" v-model="showAllTrains"/>
|
||||||
|
<label class="form-check-label" for="showAllTrains">Select All Trains</label>
|
||||||
|
</div>
|
||||||
<div class="form-check form-switch">
|
<div class="form-check form-switch">
|
||||||
<input class="form-check-input" type="checkbox" role="switch" id="showMainland" v-model="showMainland"/>
|
<input class="form-check-input" type="checkbox" role="switch" id="showMainland" v-model="showMainland"/>
|
||||||
<label class="form-check-label" for="showMainland">Mainline Trains</label>
|
<label class="form-check-label" for="showMainland">Mainline Trains</label>
|
||||||
@ -164,6 +168,7 @@ export default {
|
|||||||
showAllStations: true,
|
showAllStations: true,
|
||||||
showMainlandStations: true,
|
showMainlandStations: true,
|
||||||
showDARTStations: true,
|
showDARTStations: true,
|
||||||
|
showAllTrains: true,
|
||||||
showLate: true,
|
showLate: true,
|
||||||
showOnTime: true,
|
showOnTime: true,
|
||||||
showMainland: true,
|
showMainland: true,
|
||||||
@ -300,6 +305,17 @@ export default {
|
|||||||
this.showMainlandStations = this.showAllStations;
|
this.showMainlandStations = this.showAllStations;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// method to select all trains
|
||||||
|
selectAllTrains() {
|
||||||
|
this.showLate = this.showAllTrains;
|
||||||
|
this.showOnTime = this.showAllTrains;
|
||||||
|
this.showMainland = this.showAllTrains;
|
||||||
|
this.showDART = this.showAllTrains;
|
||||||
|
this.showRunning = this.showAllTrains;
|
||||||
|
this.showTerminated = this.showAllTrains;
|
||||||
|
this.showNotYetRunning = this.showAllTrains;
|
||||||
|
},
|
||||||
|
|
||||||
// method to display a selected train
|
// method to display a selected train
|
||||||
getSelectedTrain(i) {
|
getSelectedTrain(i) {
|
||||||
store.setSelectedTrain(this.allTrains[i]);
|
store.setSelectedTrain(this.allTrains[i]);
|
||||||
|
Reference in New Issue
Block a user