From 055b1eed65187979eb25a41fdf3536bc445cfac4 Mon Sep 17 00:00:00 2001 From: Pierre Paridans Date: Fri, 20 Aug 2021 08:44:12 +0000 Subject: [PATCH] [FIX] web: backport mobile OS detection support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit backports the mobile OS detection support, and specifically Android & iOS one to allow more specific targeting of edge cases (i.e. disabling native date picker in the mobile iOS app only). opw-2613810 closes odoo/odoo#75577 X-original-commit: 7015dcd56566e93418f51e8e3562f384d10b4ffa Related: odoo/enterprise#20446 Signed-off-by: Adrien Dieudonné (adr) Signed-off-by: Pierre Paridans --- addons/web/static/src/legacy/js/services/config.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/addons/web/static/src/legacy/js/services/config.js b/addons/web/static/src/legacy/js/services/config.js index dde878f102d..4a428103de7 100644 --- a/addons/web/static/src/legacy/js/services/config.js +++ b/addons/web/static/src/legacy/js/services/config.js @@ -42,6 +42,20 @@ var config = { * @type Number */ size_class: null, + /** + * Mobile OS (Android) device detection using userAgent. + * This flag doesn't depend on the size/resolution of the screen. + * + * @return Boolean + */ + isAndroid: isAndroid, + /** + * Mobile OS (iOS) device detection using userAgent. + * This flag doesn't depend on the size/resolution of the screen. + * + * @return Boolean + */ + isIOS: isIOS, /** * A frequent use case is to have a different render in 'mobile' mode, * meaning when the screen is small. This flag (boolean) is true when