justspamjustin / BossView

Manage your Marionette.js views like a boss! Manages events and rendering of sub-views.
http://justspamjustin.github.io/BossView/
MIT License
48 stars 6 forks source link

_getSubViewRenderConditions does not use _.result to resolve the property #8

Open billjamesdev opened 9 years ago

billjamesdev commented 9 years ago

It would be good if getSubViewRenderConditions would use .result to resolve the "subViewRenderConditions" property. In the code for our BossView, we want to specify other methods in the View as the render condition methods, but can't, since you can't reference other methods in the same object when creating an object in code.

subViewRenderConditions: {
     view1: this.testCondition1,
     view2: this.testCondition2
}

The above case does NOT work, as testCondition1 and testCondition2 are methods on the currently-being-defined view. You would need to do something like this:

subViewRenderConditions: function() {
     return {
          view1: this.testCondition1,
          view2: this.testCondition2
     }
}

This WOULD work, if getSubViewRenderConditions used .result.