Hi,
I have created my own controller class that has an option to not clear all yields. The implementation is hacky and I believe there is a great chance that it will break some day when Batman gets updated. The code is like:
class My.Controller extends Batman.Controller
clearAllYields: false
_empty: ->
dispatch: ->
if not @clearAllYields
cycleAll = Batman.DOM.Yield.cycleAll
clearAllStale = Batman.DOM.Yield.clearAllStale
Batman.DOM.Yield.cycleAll = @_empty
Batman.DOM.Yield.clearAllStale = @_empty
ret = super
if not @clearAllYields
Batman.DOM.Yield.cycleAll = cycleAll
Batman.DOM.Yield.clearAllStale = clearAllStale
ret
Using this implementation you need to keep in mind that you have to keep all yields in sync by yourself. For example in my case I have routes like /foos/42/bars/42/baz/42. If I go to /foos/42 a layout that has nested yield for bars are rendered. There are no problems when user first goes to foos and then to bars. But if one enter directly route /foos/42/bars/42 (by bookmarking or something) I need to make sure that all the higher level layouts will be rendered also. This kind of sucks and I hope I have time some day to write a controller class that supports this without dirty hacks. I have gone through all the trouble because our app really benefits from this.
Cheers,
Lauri