diff --git a/src/App.vue b/src/App.vue index e25fee5..89d1699 100644 --- a/src/App.vue +++ b/src/App.vue @@ -153,6 +153,8 @@ export default class App extends Vue { } mounted() { + this.detectIEVersion(); + if (StorageManager.getStringValue("version") != this.VERSION) { StorageManager.setStringValue("version", this.VERSION); @@ -164,6 +166,21 @@ export default class App extends Vue { this.hasReleaseNotes && !StorageManager.getBooleanValue("version_notes_read"); } + + detectIEVersion() { + var rv = -1; + if (navigator.appName == "Microsoft Internet Explorer") { + var ua = navigator.userAgent; + var re = new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})"); + if (re.exec(ua) != null) rv = parseFloat(RegExp.$1); + } else if (navigator.appName == "Netscape") { + var ua = navigator.userAgent; + var re = new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})"); + if (re.exec(ua) != null) rv = parseFloat(RegExp.$1); + } + + console.log("IE version:", rv); + } } diff --git a/src/components/Global/SelectBox.vue b/src/components/Global/SelectBox.vue index 2eadb5b..8d632ac 100644 --- a/src/components/Global/SelectBox.vue +++ b/src/components/Global/SelectBox.vue @@ -2,7 +2,10 @@
@@ -24,6 +26,7 @@ import { Component, Vue, Prop, Watch, Emit } from "vue-property-decorator"; export default class SelectBox extends Vue { @Prop({ required: true }) title!: string; @Prop({ required: true }) itemList!: { id: string | number; value: string }[]; + @Prop() bgColor!: string; @Emit("selected") onItemSelected() { @@ -47,19 +50,20 @@ export default class SelectBox extends Vue { .select-box { &_content { + // display: inline-block; + position: relative; - margin: 0.5em 0; + margin: 0.5em auto; } select { border: none; outline: none; - min-width: 10em; - - background-color: #333; - border-radius: 0.5em; + background: #333; padding: 0.35em 0.5em; + padding-right: 2em; + border-radius: 0.5em; font-size: 1em; color: white; @@ -73,7 +77,13 @@ export default class SelectBox extends Vue { transition: all 0.3s; &:focus { - background: #5c5c5c; + // border: 1px solid red; + + background: #777; + + option { + background: #333; + } } } @@ -81,13 +91,13 @@ export default class SelectBox extends Vue { position: relative; } - span { + .arrows { $arrowCol: #d8d8d8; $arrowWidth: 0.35em; position: absolute; top: 20%; - right: 0.25em; + // right: 0.25em; pointer-events: none; diff --git a/src/components/SceneryView/SceneryTimetable.vue b/src/components/SceneryView/SceneryTimetable.vue index 280f665..ab656f3 100644 --- a/src/components/SceneryView/SceneryTimetable.vue +++ b/src/components/SceneryView/SceneryTimetable.vue @@ -16,28 +16,18 @@ - - - + {{ $t("app.loading") @@ -156,32 +146,24 @@ export default class SceneryTimetable extends Vue { listOpen: boolean = false; selectedOption: string = ""; - mounted() { + loadSelectedOption() { + if (!this.stationInfo) return; if (!this.stationInfo.checkpoints) return; + if (this.selectedOption != "") return; - if (this.selectedOption == "") - this.selectedOption = this.stationInfo.checkpoints[0].checkpointName; + this.selectedOption = this.stationInfo.checkpoints[0].checkpointName; + } + + mounted() { + this.loadSelectedOption(); } activated() { - if (!this.stationInfo) return; - if (!this.stationInfo.checkpoints) return; - - if (this.selectedOption == "") - this.selectedOption = this.stationInfo.checkpoints[0].checkpointName; - } - - toggleOptionList() { - this.listOpen = !this.listOpen; - } - - closeOptionList() { - this.listOpen = false; + this.loadSelectedOption(); } chooseOption(name: string) { this.selectedOption = name; - this.closeOptionList(); } get currentURL() { @@ -255,9 +237,6 @@ h3 { } .select-box { - display: flex; - justify-content: center; - font-size: 1.2em; }