angular-ui/bootstrap — pull request #487 by asans (2013-05-30 22:53:01+00:00)
Title: Check dialog is open before closing in state change

Current code will issue a close and decrement the activeBackdrops value to below 0 when changing state, even when the dialog is already closed. This causes future dialogs to not have the backdrop inserted afterwards. A check is needed first before close() to resolve this issue.