From ccd5a1f8452ed1846c24bf4ae4ea707abc4f5fe1 Mon Sep 17 00:00:00 2001 From: Andrew Sanjanwala Date: Wed, 11 Jan 2017 11:18:19 -0500 Subject: [PATCH] Make the checkout compatible with IE11 This browser may only account for <10% of all traffic on many sites, but that's still a statistically significant quantity. --- .../view/frontend/web/js/view/cart/totals.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Checkout/view/frontend/web/js/view/cart/totals.js b/app/code/Magento/Checkout/view/frontend/web/js/view/cart/totals.js index a51a70ea28727..1994f7e644689 100644 --- a/app/code/Magento/Checkout/view/frontend/web/js/view/cart/totals.js +++ b/app/code/Magento/Checkout/view/frontend/web/js/view/cart/totals.js @@ -19,10 +19,22 @@ define([ initialize: function () { this._super(); totalsService.totals.subscribe(function () { - $(window).trigger('resize'); + if (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0) { + var evt = document.createEvent('UIEvents'); + evt.initUIEvent('resize', true, false, window, 0); + window.dispatchEvent(evt); + } else { + window.dispatchEvent(new Event('resize')); + } }); shippingService.getShippingRates().subscribe(function () { - $(window).trigger('resize'); + if (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0) { + var evt = document.createEvent('UIEvents'); + evt.initUIEvent('resize', true, false, window, 0); + window.dispatchEvent(evt); + } else { + window.dispatchEvent(new Event('resize')); + } }); } });