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

This commit is contained in:
Jeremy Ashkenas
2012-05-14 14:42:58 -04:00
2 changed files with 6 additions and 5 deletions

View File

@@ -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 File

@@ -845,7 +845,7 @@ if (note.has("title")) {
<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 @@ ActiveRecord::Base.include_root_in_json = false
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>