##// END OF EJS Templates
Make output widget reactive.
Jonathan Frederic -
Show More
@@ -400,6 +400,9 define([
400 this._append_javascript_error(err, subarea);
400 this._append_javascript_error(err, subarea);
401 this.element.append(toinsert);
401 this.element.append(toinsert);
402 }
402 }
403
404 // Notify others of changes.
405 this.element.trigger('changed');
403 };
406 };
404
407
405
408
@@ -832,6 +835,10 define([
832 // them to fire if the image is never added to the page.
835 // them to fire if the image is never added to the page.
833 this.element.find('img').off('load');
836 this.element.find('img').off('load');
834 this.element.html("");
837 this.element.html("");
838
839 // Notify others of changes.
840 this.element.trigger('changed');
841
835 this.outputs = [];
842 this.outputs = [];
836 this.trusted = true;
843 this.trusted = true;
837 this.unscroll_area();
844 this.unscroll_area();
@@ -21,6 +21,21 define([
21 prompt_area: false,
21 prompt_area: false,
22 events: this.model.widget_manager.notebook.events,
22 events: this.model.widget_manager.notebook.events,
23 keyboard_manager: this.model.widget_manager.keyboard_manager });
23 keyboard_manager: this.model.widget_manager.keyboard_manager });
24
25 // Make output area reactive.
26 var that = this;
27 this.output_area.element.on('changed', function() {
28 that.model.set('contents', that.output_area.element.html());
29 });
30 this.model.on('change:contents', function(){
31 var html = this.model.get('contents');
32 if (this.output_area.element.html() != html) {
33 this.output_area.element.html(html);
34 }
35 }, this);
36
37 // Set initial contents.
38 this.output_area.element.html(this.model.get('contents'));
24 },
39 },
25
40
26 _handle_route_msg: function(content) {
41 _handle_route_msg: function(content) {
General Comments 0
You need to be logged in to leave comments. Login now