Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:documentcloud/backbone

  • Loading branch information...
commit f14198433341f025c47300e234db1fbb39fa5228 2 parents 080241a + 291bfad
@jashkenas authored
Showing with 6 additions and 5 deletions.
  1. +2 −4 backbone.js
  2. +4 −1 index.html
View
6 backbone.js
@@ -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;
@@ -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;
}
}
}
View
5 index.html
@@ -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>
@@ -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>

0 comments on commit f141984

Please sign in to comment.
Something went wrong with that request. Please try again.