From a599db4eb9c4e8d13f567e9d096f1409d1fe2ead Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 5 Sep 2017 12:57:01 -0700 Subject: [PATCH] Choose prettier default settings for the demo --- demo/client/html/text-demo.html.hbs | 8 ++++---- demo/client/src/app-controller.ts | 9 ++++++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/demo/client/html/text-demo.html.hbs b/demo/client/html/text-demo.html.hbs index 4ff2ae37..25d43ddc 100644 --- a/demo/client/html/text-demo.html.hbs +++ b/demo/client/html/text-demo.html.hbs @@ -21,9 +21,9 @@
@@ -31,10 +31,10 @@
diff --git a/demo/client/src/app-controller.ts b/demo/client/src/app-controller.ts index b3a56f09..1765bf2e 100644 --- a/demo/client/src/app-controller.ts +++ b/demo/client/src/app-controller.ts @@ -19,7 +19,14 @@ export abstract class AppController { } protected loadInitialFile() { - this.fetchFile(this.defaultFile); + const selectFileElement = document.getElementById('pf-select-file') as + (HTMLSelectElement | null); + if (selectFileElement != null) { + const selectedOption = selectFileElement.selectedOptions[0] as HTMLOptionElement; + this.fetchFile(selectedOption.value); + } else { + this.fetchFile(this.defaultFile); + } } protected fetchFile(file: string) {