Skip to content

Commit

Permalink
Merge pull request jashkenas#2400 from tgriesser/removing-silent-docs
Browse files Browse the repository at this point in the history
Consolidating references to silenced events
  • Loading branch information
jashkenas committed Mar 20, 2013
2 parents f44defc + c122375 commit a51c874
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,11 @@ <h2 id="Events">Backbone.Events</h2>
<li><b>"all"</b> &mdash; this special event fires for <i>any</i> triggered event, passing the event name as the first argument. </li>
</ul>

<p>
Several events (<tt>add</tt>, <tt>remove</tt>, <tt>reset</tt>, <tt>sort</tt>, <tt>add</tt>, and <tt>change</tt>) may be silenced,
by passing a <tt>{silent: true}</tt> flag in the options on the triggering method.
</p>

<h2 id="Model">Backbone.Model</h2>

<p>
Expand Down Expand Up @@ -999,11 +1004,10 @@ <h2 id="Model">Backbone.Model</h2>
<b class="header">set</b><code>model.set(attributes, [options])</code>
<br />
Set a hash of attributes (one or many) on the model. If any of the attributes
change the model's state, a <tt>"change"</tt> event will be triggered, unless
<tt>{silent: true}</tt> is passed as an option. Change events for specific
attributes are also triggered, and you can bind to those as well, for example:
<tt>change:title</tt>, and <tt>change:content</tt>. You may also pass
individual keys and values.
change the model's state, a <tt>"change"</tt> event will be triggered on the model.
Change events for specific attributes are also triggered, and you can bind
to those as well, for example: <tt>change:title</tt>, and <tt>change:content</tt>.
You may also pass individual keys and values.
</p>

<pre>
Expand Down Expand Up @@ -1708,9 +1712,8 @@ <h2 id="Collection">Backbone.Collection</h2>
<p id="Collection-add">
<b class="header">add</b><code>collection.add(models, [options])</code>
<br />
Add a model (or an array of models) to the collection. Fires an <tt>"add"</tt>
event, which you can pass <tt>{silent: true}</tt> to suppress. If a
<a href="#Collection-model">model</a> property is defined, you may also pass
Add a model (or an array of models) to the collection, firing an <tt>"add"</tt>
event. If a <a href="#Collection-model">model</a> property is defined, you may also pass
raw attributes objects, and have them be vivified as instances of the model.
Pass <tt>{at: index}</tt> to splice the model into the collection at the
specified <tt>index</tt>. If you're adding models to the collection that are
Expand Down Expand Up @@ -1753,9 +1756,8 @@ <h2 id="Collection">Backbone.Collection</h2>
you have so many models to change that you'd rather just update the collection
in bulk. Use <b>reset</b> to replace a collection with a new list
of models (or attribute hashes), triggering a single <tt>"reset"</tt> event
at the end. Pass <tt>{silent: true}</tt> to suppress the <tt>"reset"</tt> event.
For convenience, within a <tt>"reset"</tt> event, the list of any previous
models is available as <tt>options.previousModels</tt>.
at the end. For convenience, within a <tt>"reset"</tt> event, the list of any
previous models is available as <tt>options.previousModels</tt>.
</p>

<p>
Expand Down Expand Up @@ -1917,9 +1919,7 @@ <h2 id="Collection">Backbone.Collection</h2>
normal circumstances, as a collection with a <a href="#Collection-comparator">comparator</a>
will sort itself whenever a model is added. To disable sorting when adding
a model, pass <tt>{sort: false}</tt> to <tt>add</tt>. Calling <b>sort</b>
triggers a <tt>"sort"</tt> event on the collection, unless silenced by
passing
<tt>{silent: true}</tt>.
triggers a <tt>"sort"</tt> event on the collection.
</p>

<p id="Collection-pluck">
Expand Down

0 comments on commit a51c874

Please sign in to comment.