From 126cdd910a632dc44b95c5efacfffc0e0487ccee Mon Sep 17 00:00:00 2001 From: Chad Boschert Date: Mon, 19 Nov 2018 15:10:33 -0600 Subject: [PATCH] Added IE11 polyfill to resolve client-side error that prevented wizard step from rendering --- assets/javascripts/wizard/initializers/custom.js.es6 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/assets/javascripts/wizard/initializers/custom.js.es6 b/assets/javascripts/wizard/initializers/custom.js.es6 index 10c05d77..c426514e 100644 --- a/assets/javascripts/wizard/initializers/custom.js.es6 +++ b/assets/javascripts/wizard/initializers/custom.js.es6 @@ -16,6 +16,18 @@ export default { const autocomplete = requirejs('discourse/lib/autocomplete').default; const cook = requirejs('discourse/plugins/discourse-custom-wizard/wizard/lib/text-lite').cook; + // IE11 Polyfill - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries#Polyfill + if (!Object.entries) + Object.entries = function( obj ){ + var ownProps = Object.keys( obj ), + i = ownProps.length, + resArray = new Array(i); // preallocate the Array + while (i--) + resArray[i] = [ownProps[i], obj[ownProps[i]]]; + + return resArray; + }; + $.fn.autocomplete = autocomplete; // this is for discourse/lib/utilities.avatarImg;