From 83654a29d633ee3a92cf74fea10cd2671625c43a Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Tue, 28 Sep 2021 10:53:40 +0300 Subject: [PATCH] [SSE mobile] adapt start markup for ios devices --- apps/common/mobile/resources/css/skeleton.css | 6 +++--- apps/spreadsheeteditor/mobile/src/index_dev.html | 14 ++++++++------ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/apps/common/mobile/resources/css/skeleton.css b/apps/common/mobile/resources/css/skeleton.css index 8ec1af34b..b6fcad21d 100644 --- a/apps/common/mobile/resources/css/skeleton.css +++ b/apps/common/mobile/resources/css/skeleton.css @@ -26,15 +26,15 @@ body { height: calc(56px + 26px); } -.skl-navbar.skl-navbar--word { +.skl-navbar.skl-navbar--word:not(.skl-navbar--ios) { background-color: #446995; } -.skl-navbar.skl-navbar--cell { +.skl-navbar.skl-navbar--cell:not(.skl-navbar--ios) { background-color: #40865c; } -.skl-navbar.skl-navbar--slide { +.skl-navbar.skl-navbar--slide:not(.skl-navbar--ios) { background-color: #aa5252; } diff --git a/apps/spreadsheeteditor/mobile/src/index_dev.html b/apps/spreadsheeteditor/mobile/src/index_dev.html index e6b8bad19..463be360a 100644 --- a/apps/spreadsheeteditor/mobile/src/index_dev.html +++ b/apps/spreadsheeteditor/mobile/src/index_dev.html @@ -41,11 +41,13 @@ // Framework7 doesn't set Device.android flag when navigator.platform == 'Win32', change it for debug navigator.__defineGetter__('platform', () => 'Win32Debug'); + const element_add_class = (el, cls) => { + el && el.classList.add(cls) + } + let navbar = document.querySelector('.skl-navbar'); if ( window.devicePixelRatio ) { - if ( navbar ) { - navbar.classList.add(`skl-pixel-ratio--${Math.floor(window.devicePixelRatio)}`); - } + element_add_class(navbar, `skl-pixel-ratio--${Math.floor(window.devicePixelRatio)}`); } if ( !isAndroid ) { @@ -57,11 +59,11 @@ Object.defineProperty(navigator, 'userAgent', { get: function () { return `iPad; CPU OS 11_0 ${ua}`; } }); + } else { + element_add_class(navbar, `skl-navbar--ios`); } } else { - if ( navbar ) { - navbar.classList.add('skl-navbar--md'); - } + element_add_class(navbar, `skl-navbar--md`); } const getUrlParams = () => {