Guest User

Untitled

a guest
Oct 16th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. // A mixin for `Em.ContainerView` that allows an initial render from
  2. // a template, followed by further additions by mutating childViews.
  3. // Note that the template should *only* contain calls to
  4. // `{{childView}}`
  5. App.Mixins.TemplateContainerView = Em.Mixin.create({
  6.  
  7. render: function() {
  8. if (!this.get('_renderedFromTemplate')) {
  9. Em.View.prototype.render.apply(this, arguments);
  10. this.set('_renderedFromTemplate', true);
  11. } else {
  12. return this._super.apply(this, arguments);
  13. }
  14. }
  15.  
  16. });
  17.  
  18. App.Views.TemplateContainerView = Em.ContainerView.extend(App.Mixins.TemplateContainerView);
Add Comment
Please, Sign In to add comment