MDL-38851 javascript: Adjust dialogues for fullscreen on resize

Makes them more responsive - e.g. when resizing a browser window manually.