(withChanges)
| 84 | } |
| 85 | |
| 86 | clone (withChanges) { |
| 87 | // Backbone does not support nested documents |
| 88 | if (withChanges == null) { withChanges = true } |
| 89 | const clone = super.clone() |
| 90 | clone.set($.extend(true, {}, withChanges || !this._revertAttributes ? this.attributes : this._revertAttributes)) |
| 91 | if (this._revertAttributes && !withChanges) { |
| 92 | // remove any keys that are in the current attributes not in the snapshot |
| 93 | for (const key of Array.from(_.difference(_.keys(clone.attributes), _.keys(this._revertAttributes)))) { |
| 94 | clone.unset(key) |
| 95 | } |
| 96 | } |
| 97 | return clone |
| 98 | } |
| 99 | |
| 100 | onError (level, jqxhr) { |
| 101 | this.loading = false |
no test coverage detected