mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-30 03:00:06 -04:00
Merge branch 'master' of github.com:documentcloud/backbone
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user