Skip to content

Commit

Permalink
build v1.0.0-rc6
Browse files Browse the repository at this point in the history
  • Loading branch information
Derick Bailey committed Feb 9, 2013
1 parent cb15487 commit b927015
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 39 deletions.
31 changes: 20 additions & 11 deletions lib/backbone.marionette.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Backbone.Marionette, v1.0.0-rc5
// Backbone.Marionette, v1.0.0-rc6
// Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
// http://github.com/marionettejs/backbone.marionette
Expand Down Expand Up @@ -1240,8 +1240,16 @@ Marionette.CollectionView = Marionette.View.extend({
// the collection view.
render: function(){
this.isClosed = false;

this.triggerBeforeRender();
this._renderChildren();
this.triggerRendered();
return this;
},

// Internal method. Separated so that CompositeView can have
// more control over events being triggered, around the rendering
// process
_renderChildren: function(){
this.closeEmptyView();
this.closeChildren();

Expand All @@ -1250,9 +1258,6 @@ Marionette.CollectionView = Marionette.View.extend({
} else {
this.showEmptyView();
}

this.triggerRendered();
return this;
},

// Internal method to loop through each item in the
Expand Down Expand Up @@ -1462,7 +1467,7 @@ Marionette.CompositeView = Marionette.CollectionView.extend({
if (this.collection){
this.listenTo(this.collection, "add", this.addChildView, this);
this.listenTo(this.collection, "remove", this.removeItemView, this);
this.listenTo(this.collection, "reset", this.renderCollection, this);
this.listenTo(this.collection, "reset", this._renderChildren, this);
}
},

Expand Down Expand Up @@ -1500,30 +1505,34 @@ Marionette.CompositeView = Marionette.CollectionView.extend({
// but the collection will not re-render.
render: function(){
this.isClosed = false;

this.resetItemViewContainer();

this.triggerBeforeRender();
var html = this.renderModel();
this.$el.html(html);

// the ui bindings is done here and not at the end of render since they
// will not be available until after the model is rendered, but should be
// available before the collection is rendered.
this.bindUIElements();

this.triggerMethod("composite:model:rendered");

this.renderCollection();
this._renderChildren();

this.triggerMethod("composite:rendered");
this.triggerRendered();
return this;
},

_renderChildren: function(){
Marionette.CollectionView.prototype._renderChildren.call(this);
this.triggerMethod("composite:collection:rendered");
},

// Render the collection for the composite view
renderCollection: function(){
var args = Array.prototype.slice.apply(arguments);
Marionette.CollectionView.prototype.render.apply(this, args);

this.triggerMethod("composite:collection:rendered");
},

// Render an individual model, if we have one, as
Expand Down
4 changes: 2 additions & 2 deletions lib/backbone.marionette.min.js

Large diffs are not rendered by default.

31 changes: 20 additions & 11 deletions lib/core/amd/backbone.marionette.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Backbone.Marionette, v1.0.0-rc5
// Backbone.Marionette, v1.0.0-rc6
// Copyright (c)2013 Derick Bailey, Muted Solutions, LLC.
// Distributed under MIT license
// http://github.com/marionettejs/backbone.marionette
Expand Down Expand Up @@ -924,8 +924,16 @@
// the collection view.
render: function(){
this.isClosed = false;

this.triggerBeforeRender();
this._renderChildren();
this.triggerRendered();
return this;
},

// Internal method. Separated so that CompositeView can have
// more control over events being triggered, around the rendering
// process
_renderChildren: function(){
this.closeEmptyView();
this.closeChildren();

Expand All @@ -934,9 +942,6 @@
} else {
this.showEmptyView();
}

this.triggerRendered();
return this;
},

// Internal method to loop through each item in the
Expand Down Expand Up @@ -1146,7 +1151,7 @@
if (this.collection){
this.listenTo(this.collection, "add", this.addChildView, this);
this.listenTo(this.collection, "remove", this.removeItemView, this);
this.listenTo(this.collection, "reset", this.renderCollection, this);
this.listenTo(this.collection, "reset", this._renderChildren, this);
}
},

Expand Down Expand Up @@ -1184,30 +1189,34 @@
// but the collection will not re-render.
render: function(){
this.isClosed = false;

this.resetItemViewContainer();

this.triggerBeforeRender();
var html = this.renderModel();
this.$el.html(html);

// the ui bindings is done here and not at the end of render since they
// will not be available until after the model is rendered, but should be
// available before the collection is rendered.
this.bindUIElements();

this.triggerMethod("composite:model:rendered");

this.renderCollection();
this._renderChildren();

this.triggerMethod("composite:rendered");
this.triggerRendered();
return this;
},

_renderChildren: function(){
Marionette.CollectionView.prototype._renderChildren.call(this);
this.triggerMethod("composite:collection:rendered");
},

// Render the collection for the composite view
renderCollection: function(){
var args = Array.prototype.slice.apply(arguments);
Marionette.CollectionView.prototype.render.apply(this, args);

this.triggerMethod("composite:collection:rendered");
},

// Render an individual model, if we have one, as
Expand Down
Loading

0 comments on commit b927015

Please sign in to comment.