Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Commit

Permalink
Merge pull request #661 from jperasmus/gh-pages
Browse files Browse the repository at this point in the history
Fixed indentation and added indication that code was updated
  • Loading branch information
addyosmani committed Jun 21, 2015
2 parents 8595c96 + 2d69f9c commit 97451db
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
24 changes: 12 additions & 12 deletions chapters/05-exercise-2.md
Expand Up @@ -558,14 +558,14 @@ app.post( '/api/books', function( request, response ) {
author: request.body.author,
releaseDate: request.body.releaseDate
});

return book.save( function( err ) {
if( !err ) {
console.log( 'created' );
return response.send( book );
} else {
console.log( err );
}
} else {
console.log( err );
}
});
});
```
Expand Down Expand Up @@ -649,10 +649,10 @@ app.put( '/api/books/:id', function( request, response ) {
return book.save( function( err ) {
if( !err ) {
console.log( 'book updated' );
return response.send( book );
} else {
console.log( err );
}
return response.send( book );
} else {
console.log( err );
}
});
});
});
Expand Down Expand Up @@ -826,9 +826,9 @@ url HTTP Method Operation
To have our application retrieve the Book models from the server on page load, we need to update the LibraryView. The Backbone documentation recommends inserting all models when the page is generated on the server side, rather than fetching them from the client side once the page is loaded. Since this chapter is trying to give you a more complete picture of how to communicate with a server, we will go ahead and ignore that recommendation. Go to the LibraryView declaration and update the initialize function as follows:

```javascript
initialize: function() {
this.collection = new app.Library();
this.collection.fetch({reset: true}); // NEW
initialize: function() { // UPDATED
this.collection = new app.Library(); // UPDATED
this.collection.fetch({reset: true}); // NEW
this.render();

this.listenTo( this.collection, 'add', this.renderBook );
Expand All @@ -844,7 +844,7 @@ Now that we are populating our Library from the database using `this.collection.
var app = app || {};

$(function() {
new app.LibraryView();
new app.LibraryView(); // UPDATED
});
```

Expand Down
4 changes: 2 additions & 2 deletions chapters/10-pagination.md
Expand Up @@ -20,7 +20,7 @@ On this topic, we're going to go through a set of pagination components I (and a
### Backbone.Paginator

**Note:** As of Backbone.Paginator [2.0](https://github.com/backbone-paginator/backbone.paginator/releases), the API to
the project has changed and includes updated which break backwards compatibility. The below section refers to Backbone.Paginator
the project has changed and includes updates which break backwards compatibility. The below section refers to Backbone.Paginator
1.0 which can still be downloaded [here](https://github.com/backbone-paginator/backbone.paginator/releases/tag/v1.0.0).

When working with data on the client-side, the three types of pagination we are most likely to run into are:
Expand Down Expand Up @@ -532,7 +532,7 @@ Note: Both the clientPager and requestPager ```bootstrap``` function will accept
### Styling
You're of course free to customize the overall look and feel of the paginators as much as you wish. By default, all sample applications make use of the [Twitter Bootstrap](http://twitter.github.com/bootstrap) for styling links, buttons and drop-downs.
You're of course free to customize the overall look and feel of the paginators as much as you wish. By default, all sample applications make use of [Twitter Bootstrap](http://twitter.github.com/bootstrap) for styling links, buttons and drop-downs.
CSS classes are available to style record counts, filters, sorting and more:
Expand Down
2 changes: 1 addition & 1 deletion chapters/11-bbb.md
Expand Up @@ -31,7 +31,7 @@ Notes on build tool steps:

To get started we're going to install Grunt-BBB, which will include Backbone Boilerplate and any third-party dependencies it might need such as the Grunt build tool.

We can install Grunt-bBB via NPM by running:
We can install Grunt-BBB via NPM by running:

```shell
npm install -g bbb
Expand Down

0 comments on commit 97451db

Please sign in to comment.