diff --git a/index.html b/index.html index a7d995a3..200e7cf2 100644 --- a/index.html +++ b/index.html @@ -624,7 +624,7 @@ of data-structuring (models and collections) and user interface (views and URLs) primitives that are generally useful when building web applications with JavaScript. In an ecosystem where overarching, decides-everything-for-you - frameworks are commonplace, and many libraries require your site to be + frameworks are commonplace, and many libraries require your site to be reorganized to suit their look, feel, and default behavior — Backbone should continue to be a tool that gives you the freedom to design the full experience of your web application. @@ -679,11 +679,11 @@
removecollection.remove(models, [options])
- Remove a model (or an array of models) from the collection, and returns them.
+ Remove a model (or an array of models) from the collection, and returns them.
Fires a "remove" event, which you can use silent to suppress.
The model's index before removal is available to listeners as
options.index.
@@ -2645,9 +2645,9 @@ ui.Chapter = Backbone.View.extend({
templateview.template([data])
While templating for a view isn't a function provided directly by Backbone,
- it's often a nice convention to define a template function on your
+ it's often a nice convention to define a template function on your
views. In this way, when rendering your view, you have convenient access to
- instance data.
+ instance data.
For example, using Underscore templates:
- Delicious is a social bookmarking - platform making it easy to save, sort, and store bookmarks from across - the web. Delicious uses Chaplin.js, - Backbone.js and AppCache to build a full-featured MVC web app. - The use of Backbone helped the website and - mobile apps share a - single API service, and the reuse of the model tier made it significantly + Delicious is a social bookmarking + platform making it easy to save, sort, and store bookmarks from across + the web. Delicious uses Chaplin.js, + Backbone.js and AppCache to build a full-featured MVC web app. + The use of Backbone helped the website and + mobile apps share a + single API service, and the reuse of the model tier made it significantly easier to share code during the recent Delicious redesign.
@@ -3941,18 +3941,30 @@ inbox.messages.fetch({reset: true}); Binding "this"
- When binding callbacks to Backbone events, you can choose to pass an optional - third argument to specify the this that will be used when the - callback is later invoked: + You may also find it helpful to use + _.bind and + _.bindAll + from Underscore.js. Be aware, however, that due to an imperfect shim in older + browsers, the bound function's arity (that is, its length + property) is not preserved when a native bind is not present. + This is known to cause problems with constructor and collection + comparator + functions bound from within the object instance and this pattern is + highly discouraged for this reason.
@@ -3963,6 +3975,8 @@ var MessageList = Backbone.View.extend({
messages.on("reset", this.render, this);
messages.on("add", this.addMessage, this);
messages.on("remove", this.removeMessage, this);
+
+ messsages.each(this.addMessage, this);
}
});
@@ -4006,13 +4020,13 @@ ActiveRecord::Base.include_root_in_json = false
1.1.0 — Oct. 10, 2013 — Diff — Docs