Skip to content

Commit

Permalink
Use body element as default parent view
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfarljw committed Nov 2, 2016
1 parent 32bef0c commit a1f6f36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/modules/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ class GelatoComponent extends Gelato.View {
}

renderTemplate(context) {
if (this.container) {
this.parent.$(this.container).html(this.$el);
}
this.parent.find(this.container).html(this.$el);

Gelato.View.prototype.renderTemplate.call(this, context);

Expand Down
4 changes: 2 additions & 2 deletions src/modules/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class GelatoView extends Backbone.View {
super(options);

this.components = {};
this.parent = null;
this.parent = Backbone.$(document.body);
}

_handleClickNavigate(event) {
Expand Down Expand Up @@ -82,7 +82,7 @@ class GelatoView extends Backbone.View {
_.forOwn(
this.components,
(component) => {
component.parent = this;
component.parent = this.$el;

if (component.autoRender) {
component.render();
Expand Down

0 comments on commit a1f6f36

Please sign in to comment.