ajaxorg/cloud9 — pull request #1745 by gjtorikian (2012-06-24 09:25:18+00:00)
Title: Fix timing issue with collab-packed

Here's what's going on:

Concorde is listening to an event called `readfile`. Specifically, it's interested in `doc.$page`.

`readfile` is called by `filesystem.js`, who calls it after listening for `openfile`.

`editors.js` also listens for `openfile`, just to launch `openEditor()`, which, among other things, sets the `dpc.$page` property.

The packed version of collab was not working, because `doc.$page` was never being set. I traced it down to basically `editors.js` and `filesystem.js` both listening for `openfile`, and `filesystem.js` always "getting it first."

Now we basically guarantee that `openEditor()` is called, so that `doc.$page` can be set, so that concorde can be happy.

You can test this by running `make package` on infra and starting the server with `-P`.