Converted to using custom Event

This commit is contained in:
J Guthrie
2018-11-20 18:39:00 +00:00
parent 6137941efd
commit 5fc312620f
2 changed files with 12 additions and 15 deletions
+5 -15
View File
@@ -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);
+7
View File
@@ -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);
};