+ Start a Discussion

In a VF page, how to use JS wait/async methods

I'm trying to force sequential operation within a VF page, waiting for one pop up to exit before closing the original page.

The use case is this:
  • quickaction button calls VF page
  • VF page runs javascript that calls sforce.one.editRecord
  • once the sforce.one popup is closed, then and only then
  • close the originating page
I know how to do everything except the asynch wait between the second and third bullet. If at all possible, please provide a code sample that is known to work, rather than an abstract discussion.