batmanjs/batman — pull request #806 by joshpc (2013-08-21 05:37:11+00:00)
Title: Triggers viewDidAppear when rendering already-rendered-views

## What bug this PR fixes
With the view cache enabled, when attempting to render the same page (i.e you're on 'products' and you have a data-route to 'products') it will do nothing. When you attempt to do anything else, you get a warning in the console: **Warning! Trying to redirect but an action has already been taken during...**.

Note, this doesn't fix all of the view cache issues but it's a start.

## What this does
Triggers `viewDidAppear` whenever attempting to render a view that had already been rendered. This is problematic when the view cache is enabled, since views don't get reloaded / are already added as subviews. What happens:
1. `_ref3.add(view)` attempts to add `view` to the subviews.
2. `view` is already contained in `_ref3` thus it returns `[]`
3. Because `addSubview` is not called, and `addNodeToParent` is not called, etc. the `viewDidAppear` event does not get triggered.

The effect of triggering `viewDidAppear` is that this handler gets triggered (from `Controller.prototype.render = function(options) {`):
```
view.once('viewDidAppear', function() {
return frame != null ? frame.finishOperation() : void 0;
});
```

Which ends the frame operation, allowing other things to be processed.

@kristianpd @nickjs