From 412990e8fbee212cafd4a23bca24b70a5ad5aefa Mon Sep 17 00:00:00 2001
From: andreistroescu <andrei.g.stroescu@gmail.com>
Date: Fri, 7 Dec 2018 16:03:08 +0100
Subject: [PATCH] added screen size info to the device information
 functionality

---
 src/app/home/home.component.html | 2 +-
 src/app/home/home.component.ts   | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/app/home/home.component.html b/src/app/home/home.component.html
index ede1f5a3..7d024813 100644
--- a/src/app/home/home.component.html
+++ b/src/app/home/home.component.html
@@ -74,7 +74,7 @@
         <button  mat-raised-button color="foreground" (click)="sysInfo()">Get device info</button>
         <button mat-raised-button (click)="removeSysInfo()">Hide device info</button>
       </div>
-      <br>
+      <div>{{ screenSize }} </div>  
       <div *ngFor="let item of deviceInfo | keyvalue">
           {{item.key}}:{{item.value}}
       </div>
diff --git a/src/app/home/home.component.ts b/src/app/home/home.component.ts
index e6e9d40c..a2d5d0bf 100644
--- a/src/app/home/home.component.ts
+++ b/src/app/home/home.component.ts
@@ -21,6 +21,7 @@ export class HomeComponent implements OnInit {
   errorMessage = '';
   workspaceList: WorkspaceData[] = [];
   deviceInfo = null;
+  screenSize: any;
 
   constructor(private fb: FormBuilder,
     private mds: MainDatastoreService,
@@ -62,10 +63,11 @@ export class HomeComponent implements OnInit {
 
   sysInfo() {
     this.deviceInfo = this.deviceService.getDeviceInfo();
-    const isDesktopDevice = this.deviceService.isDesktop();
+    this.screenSize = "screen size: " + (window.screen.width) + "px" + (window.screen.height) + "px";
   }
   
   removeSysInfo() {
     this.deviceInfo = "";
+    this.screenSize = "";
   }
 }
-- 
GitLab