From ff5663969fba9d92f42985167681818e49a01192 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 3 Apr 2019 21:52:15 -0400 Subject: [PATCH] Promise Polyfill for older browsers --- bower.json | 3 ++- templates/CRM/common/l10n.js.tpl | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bower.json b/bower.json index e40429345d..b970b3e9ad 100644 --- a/bower.json +++ b/bower.json @@ -31,7 +31,8 @@ "angular-bootstrap": "^2.5.0", "angular-sanitize": "~1.5.0", "smartmenus": "~1.1", - "phantomjs-polyfill": "^0.0.2" + "phantomjs-polyfill": "^0.0.2", + "es6-promise": "^4.2.4" }, "resolutions": { "angular": "~1.5.11" diff --git a/templates/CRM/common/l10n.js.tpl b/templates/CRM/common/l10n.js.tpl index 27338c8dfc..f2047652cc 100644 --- a/templates/CRM/common/l10n.js.tpl +++ b/templates/CRM/common/l10n.js.tpl @@ -128,5 +128,11 @@ params: {}, functions: [] }; + + // Load polyfill + if (!('Promise' in window)) { + CRM.loadScript(CRM.config.resourceBase + 'bower_components/es6-promise/es6-promise.auto.min.js'); + } + })(jQuery); {/literal} -- 2.25.1