Show More
@@ -355,7 +355,7 b' define(["widgets/js/manager",' | |||
|
355 | 355 | this.pending_msgs++; |
|
356 | 356 | } |
|
357 | 357 | } |
|
358 |
// Since the comm is a one-way communication, assume the message |
|
|
358 | // Since the comm is a one-way communication, assume the message | |
|
359 | 359 | // arrived. Don't call success since we don't have a model back from the server |
|
360 | 360 | // this means we miss out on the 'sync' event. |
|
361 | 361 | this._buffered_state_diff = {}; |
@@ -383,11 +383,13 b' define(["widgets/js/manager",' | |||
|
383 | 383 | for (var i=0; i<keys.length; i++) { |
|
384 | 384 | var key = keys[i]; |
|
385 | 385 | var value = state[key]; |
|
386 |
if (value |
|
|
387 |
|
|
|
388 | buffers.push(value); | |
|
389 |
buffer |
|
|
390 |
|
|
|
386 | if (value) { | |
|
387 | if (value.buffer instanceof ArrayBuffer | |
|
388 | || value instanceof ArrayBuffer) { | |
|
389 | buffers.push(value); | |
|
390 | buffer_keys.push(key); | |
|
391 | delete state[key]; | |
|
392 | } | |
|
391 | 393 | } |
|
392 | 394 | } |
|
393 | 395 | that.comm.send({method: 'backbone', sync_data: state, buffer_keys: buffer_keys}, callbacks, {}, buffers); |
@@ -396,7 +398,7 b' define(["widgets/js/manager",' | |||
|
396 | 398 | return (utils.reject("Couldn't send widget sync message", true))(error); |
|
397 | 399 | }); |
|
398 | 400 | }, |
|
399 | ||
|
401 | ||
|
400 | 402 | save_changes: function(callbacks) { |
|
401 | 403 | /** |
|
402 | 404 | * Push this model's state to the back-end |
@@ -410,7 +412,7 b' define(["widgets/js/manager",' | |||
|
410 | 412 | /** |
|
411 | 413 | * on_some_change(["key1", "key2"], foo, context) differs from |
|
412 | 414 | * on("change:key1 change:key2", foo, context). |
|
413 |
* If the widget attributes key1 and key2 are both modified, |
|
|
415 | * If the widget attributes key1 and key2 are both modified, | |
|
414 | 416 | * the second form will result in foo being called twice |
|
415 | 417 | * while the first will call foo only once. |
|
416 | 418 | */ |
General Comments 0
You need to be logged in to leave comments.
Login now