diff --git a/modules/ui/fields/restrictions.js b/modules/ui/fields/restrictions.js index c0104a4d8..7c9fa09b8 100644 --- a/modules/ui/fields/restrictions.js +++ b/modules/ui/fields/restrictions.js @@ -66,6 +66,8 @@ export function uiFieldRestrictions(field, context) { var _intersection; var _fromWayID; + var _redrawHandler; + function restrictions(selection) { _parent = selection; @@ -301,6 +303,14 @@ export function uiFieldRestrictions(field, context) { }); } + 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 // is selected, and that way is no longer part of the intersection. @@ -661,6 +671,8 @@ export function uiFieldRestrictions(field, context) { d3_select(window) .on('resize.restrictions', null); + + clearInterval(_redrawHandler); }; diff --git a/modules/ui/sidebar.js b/modules/ui/sidebar.js index c678a44ba..b12f97889 100644 --- a/modules/ui/sidebar.js +++ b/modules/ui/sidebar.js @@ -62,6 +62,8 @@ export function uiSidebar(context) { selection .style('width', widthPct + '%') // lock in current width .style('max-width', '85%'); // but allow larger widths + + resizer.classed('dragging', true); }) .on('drag', function() { var isRTL = (textDirection === 'rtl'); @@ -97,6 +99,9 @@ export function uiSidebar(context) { } } }) + .on('end', function() { + resizer.classed('dragging', false); + }) ); var featureListWrap = selection