Prevent error when closing modal dialog
Prevent error when closing modal dialog

No Issue
- Moved sendAction outside of the event handler as calling it
  from inside was generating an error in the console.

TryGhost/Ghost,TryGhost/Ghost,TryGhost/Ghost