element.fitEmbeds([opt])

Resize the element so that it fits all the embedded elements inside it. If opt.deep is true, the resizing will be done recursively for any embedded elements that contain embedded elements themselves. Set opt.padding if you want certain padding on all the parent elements.