From 46fe46ef6eead75d37577ca8bf4c0843e0e503bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Thu, 3 Jan 2019 11:20:33 +0100 Subject: [PATCH] MOBILE-2795 ux: Add desktop platform classes --- src/app/app.component.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index c494bb511..779e8e3c6 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Component, OnInit, NgZone } from '@angular/core'; -import { Platform } from 'ionic-angular'; +import { Platform, IonicApp } from 'ionic-angular'; import { StatusBar } from '@ionic-native/status-bar'; import { CoreAppProvider } from '@providers/app'; import { CoreEventsProvider } from '@providers/events'; @@ -37,7 +37,7 @@ export class MoodleMobileApp implements OnInit { constructor(private platform: Platform, statusBar: StatusBar, logger: CoreLoggerProvider, keyboard: Keyboard, private eventsProvider: CoreEventsProvider, private loginHelper: CoreLoginHelperProvider, private zone: NgZone, private appProvider: CoreAppProvider, private langProvider: CoreLangProvider, private sitesProvider: CoreSitesProvider, - private screenOrientation: ScreenOrientation) { + private screenOrientation: ScreenOrientation, app: IonicApp) { this.logger = logger.getInstance('AppComponent'); platform.ready().then(() => { @@ -50,6 +50,12 @@ export class MoodleMobileApp implements OnInit { } keyboard.hideFormAccessoryBar(false); + + let desktopClass = this.appProvider.isDesktop() ? 'platform-desktop' : ''; + desktopClass += this.appProvider.isMac() ? ' platform-mac' : ''; + desktopClass += this.appProvider.isLinux() ? ' platform-linux' : ''; + desktopClass += this.appProvider.isWindows() ? ' platform-windows' : ''; + app.setElementClass(desktopClass, true); }); }