File tree 1 file changed +16
-2
lines changed 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -276,13 +276,27 @@ class WidgetModel extends Backbone.Model {
276
276
277
277
// Backbone only remembers the diff of the most recent set()
278
278
// operation. Calling set multiple times in a row results in a
279
- // loss of diff information. Here we keep our own running diff.
279
+ // loss of change information. Here we keep our own running diff.
280
280
//
281
281
// We don't buffer the state set in the constructor (including
282
282
// defaults), so we first check to see if we've initialized _buffered_state_diff.
283
283
// which happens after the constructor sets attributes at creation.
284
284
if ( this . _buffered_state_diff !== void 0 ) {
285
- this . _buffered_state_diff = _ . extend ( this . _buffered_state_diff , this . changedAttributes ( ) || { } ) ;
285
+ let attrs = this . changedAttributes ( ) || { } ;
286
+
287
+ // The state_lock lists attributes that are currently being changed
288
+ // right now from a kernel message. We don't want to send these
289
+ // non-changes back to the kernel, so we delete them out of attrs if
290
+ // they haven't changed from their state_lock value
291
+ if ( this . state_lock !== null ) {
292
+ for ( const key of Object . keys ( this . state_lock ) ) {
293
+ if ( attrs [ key ] === this . state_lock [ key ] ) {
294
+ delete attrs [ key ] ;
295
+ }
296
+ }
297
+ }
298
+
299
+ this . _buffered_state_diff = _ . extend ( this . _buffered_state_diff , attrs ) ;
286
300
}
287
301
return return_value ;
288
302
}
You can’t perform that action at this time.
0 commit comments