From 5fc312620ff54f4683a0d8c334334d6c0229359f Mon Sep 17 00:00:00 2001 From: J Guthrie Date: Tue, 20 Nov 2018 18:39:00 +0000 Subject: [PATCH] Converted to using custom Event --- modules/ui/fields/restrictions.js | 20 +++++--------------- modules/ui/init.js | 7 +++++++ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/modules/ui/fields/restrictions.js b/modules/ui/fields/restrictions.js index 7c9fa09b8..bfe021515 100644 --- a/modules/ui/fields/restrictions.js +++ b/modules/ui/fields/restrictions.js @@ -295,21 +295,6 @@ export function uiFieldRestrictions(field, context) { surface .call(breathe); - - d3_select(window) - .on('resize.restrictions', function() { - utilSetDimensions(_container, null); - redraw(); - }); - } - - if (!_redrawHandler) { - _redrawHandler = setInterval(function() { - if (d3_select('#sidebar-resizer').classed('dragging')) { - utilSetDimensions(_container, null); - redraw(); - } - }, 50); } // This can happen if we've lowered the detail while a FROM way @@ -345,6 +330,11 @@ export function uiFieldRestrictions(field, context) { .classed('related', true); } + document.addEventListener('resizeWindow', function (e) { + utilSetDimensions(_container, null); + redraw(); + }, false); + updateHints(null); diff --git a/modules/ui/init.js b/modules/ui/init.js index e1f5a02a3..700350945 100644 --- a/modules/ui/init.js +++ b/modules/ui/init.js @@ -411,6 +411,13 @@ export function uiInit(context) { // check if header or footer have overflowed ui.checkOverflow('#bar'); ui.checkOverflow('#footer'); + + // Use older code so it works on Explorer + var resizeWindowEvent = document.createEvent('Event'); + + resizeWindowEvent.initEvent('resizeWindow', true, true); + + document.dispatchEvent(resizeWindowEvent); };