From 384f9a36aaf5c34ca5a2052047ded7276985b5c7 Mon Sep 17 00:00:00 2001 From: "jvanboxtel@wisc.edu" <jvanboxtel@wisc.edu> Date: Fri, 29 Mar 2019 14:38:45 -0500 Subject: [PATCH] ROENROLL-1484 print android --- .../degree-planner/degree-planner.component.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/app/degree-planner/degree-planner.component.ts b/src/app/degree-planner/degree-planner.component.ts index 2dafbf4..1fb12bd 100644 --- a/src/app/degree-planner/degree-planner.component.ts +++ b/src/app/degree-planner/degree-planner.component.ts @@ -207,7 +207,21 @@ export class DegreePlannerComponent implements OnInit, OnDestroy { } public onPrintPlanClick() { - window.print(); + const ua = navigator.userAgent.toLowerCase(); + const isAndroid = ua.indexOf('android') > -1; + // window.print() is not supported on android. + if (isAndroid) { + this.dialog.open(ConfirmDialogComponent, { + data: { + title: 'Print Dialog', + confirmText: 'Ok', + text: + 'Please try to print using your browsers print function or setup Google Cloud Print.', + }, + }); + } else { + window.print(); + } } public onSharePlanClick() { -- GitLab