Skip to content

Commit

Permalink
0.3.1 - Fixes bug with closing pieces down
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesplease committed Mar 4, 2014
1 parent 8f94171 commit 5f85719
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ app.module( 'myPuppet', {
});

// Get the newly-created instance of Marionette.ItemView
app.module( 'myPuppet' ).pieces( 'somePiece' );
app.module( 'myPuppet' ).piece( 'somePiece' );
```
You can dynamically add pieces with the same method. Simply pass an already-instantiated object as the second argument.
Expand All @@ -225,7 +225,7 @@ app.module( 'myPuppet', {
var somePiece = new Backbone.Collection();

// Set a new piece
app.module( 'myPuppet' ).pieces( 'somePiece', somePiece );
app.module( 'myPuppet' ).piece( 'somePiece', somePiece );
```
You cannot overwrite a piece that already exists. Attempts to do so will be ignored, and the function will return `false`.
Expand All @@ -237,10 +237,10 @@ var somePiece = new Backbone.Collection();
var anotherPiece = new Marionette.ItemView();

// Set the piece...
app.module( 'myPuppet' ).pieces( 'somePiece', somePiece );
app.module( 'myPuppet' ).piece( 'somePiece', somePiece );

// Returns false. This piece has already been set.
app.module( 'myPuppet' ).pieces( 'somePiece', anotherPiece );
app.module( 'myPuppet' ).piece( 'somePiece', anotherPiece );
```
### Pieces Local Channel
Expand All @@ -255,7 +255,7 @@ app.module( 'myPuppet', {
}
});

var piece = app.module( 'myPuppet' ).pieces( 'somePiece' );
var piece = app.module( 'myPuppet' ).piece( 'somePiece' );

// The local channel messaging protocols
piece.vent;
Expand Down Expand Up @@ -292,7 +292,7 @@ app.module( 'myPuppet', {
}
});

var piece = app.module( 'myPuppet' ).pieces( 'somePiece' );
var piece = app.module( 'myPuppet' ).piece( 'somePiece' );

// This will automatically forward the render events to the local channel as:
// before:render:somePiece
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppets",
"version": "0.3.0",
"version": "0.3.1",
"authors": [
"Jmeas <[email protected]>"
],
Expand Down
4 changes: 2 additions & 2 deletions build/puppets.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
this._initDefaultListeners();

Marionette.Module.prototype.constructor.apply( this, Array.prototype.slice.call(arguments, 0) );

this._addFinalizers();

},
Expand All @@ -267,7 +267,7 @@
// Shut down the pieces
this.addFinalizer( function() {

_.each( this.pieces, function(piece) {
_.each( this._pieces, function(piece) {
if ( piece.off ) {
piece.off();
}
Expand Down
2 changes: 1 addition & 1 deletion build/puppets.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppets",
"version": "0.3.0",
"version": "0.3.1",
"description": "A modular framework for Marionette",
"main": "build/puppets.js",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions src/puppets.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
this._initDefaultListeners();

Marionette.Module.prototype.constructor.apply( this, Array.prototype.slice.call(arguments, 0) );

this._addFinalizers();

},
Expand All @@ -50,7 +50,7 @@
// Shut down the pieces
this.addFinalizer( function() {

_.each( this.pieces, function(piece) {
_.each( this._pieces, function(piece) {
if ( piece.off ) {
piece.off();
}
Expand Down

0 comments on commit 5f85719

Please sign in to comment.