invoke beforeOpen callback once the dialog placement ready
remove style attribute as dialog closes