Set modal margin based on scroll offset, to keep the dialog in viewport, refs T686