Show More
@@ -31,7 +31,7 define(["notebook/js/widgets/widget"], function(widget_manager){ | |||||
31 | // |
|
31 | // | |
32 | // Called when the model is changed. The model may have been |
|
32 | // Called when the model is changed. The model may have been | |
33 | // changed by another view or by a state update from the back-end. |
|
33 | // changed by another view or by a state update from the back-end. | |
34 |
var image_src = 'data:image/' + this.model.get(' |
|
34 | var image_src = 'data:image/' + this.model.get('format') + ';base64,' + this.model.get('_b64value'); | |
35 | this.$el.attr('src', image_src); |
|
35 | this.$el.attr('src', image_src); | |
36 |
|
36 | |||
37 | var width = this.model.get('width'); |
|
37 | var width = this.model.get('width'); |
@@ -27,8 +27,8 class ImageWidget(DOMWidget): | |||||
27 | view_name = Unicode('ImageView') |
|
27 | view_name = Unicode('ImageView') | |
28 |
|
28 | |||
29 | # Define the custom state properties to sync with the front-end |
|
29 | # Define the custom state properties to sync with the front-end | |
30 |
keys = [' |
|
30 | keys = ['format', 'width', 'height', '_b64value'] + DOMWidget.keys | |
31 |
|
|
31 | format = Unicode('png') | |
32 | width = Unicode() |
|
32 | width = Unicode() | |
33 | height = Unicode() |
|
33 | height = Unicode() | |
34 | _b64value = Unicode() |
|
34 | _b64value = Unicode() |
General Comments 0
You need to be logged in to leave comments.
Login now