Skip to content

Commit

Permalink
Merge branch 'master' of github.com:documentcloud/backbone
Browse files Browse the repository at this point in the history
  • Loading branch information
jashkenas committed May 14, 2012
2 parents 080241a + 291bfad commit f141984
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 2 additions & 4 deletions backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
// with that function. If `callback` is null, removes all callbacks for the
// event. If `events` is null, removes all bound callbacks for all events.
off: function(events, callback, context) {
var event, calls, list, i, length;
var event, calls, list, i;

// No events, or removing *all* events.
if (!(calls = this._callbacks)) return this;
Expand All @@ -123,11 +123,9 @@
continue;
}

for (i = 0, length = list.length; i < length; i += 2) {
for (i = list.length - 2; i >= 0; i -= 2) {
if (!(callback && list[i] !== callback || context && list[i + 1] !== context)) {
list.splice(i, 2);
i -= 2;
length -= 2;
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ <h2 id="Model">Backbone.Model</h2>
<p id="Model-clear">
<b class="header">clear</b><code>model.clear([options])</code>
<br />
Removes all attributes from the model. Fires a <tt>"change"</tt> event unless
Removes all attributes from the model, including the <tt>id</tt> attribute. Fires a <tt>"change"</tt> event unless
<tt>silent</tt> is passed as an option.
</p>

Expand Down Expand Up @@ -3583,6 +3583,9 @@ <h2 id="changelog">Change Log</h2>
Calling <tt>clone</tt> on a model now only passes the attributes
for duplication, not a reference to the model itself.
</li>
<li>
Calling <tt>clear</tt> on a model now removes the <tt>id</tt> attribute.
</li>
</ul>

<p>
Expand Down

0 comments on commit f141984

Please sign in to comment.