Show More
@@ -47,6 +47,17 b' define(["widgets/js/manager",' | |||||
47 | } else { |
|
47 | } else { | |
48 | this.set_comm_live(false); |
|
48 | this.set_comm_live(false); | |
49 | } |
|
49 | } | |
|
50 | ||||
|
51 | // Listen for the events that lead to the websocket being terminated. | |||
|
52 | var that = this; | |||
|
53 | var died = function() { | |||
|
54 | that.set_comm_live(false); | |||
|
55 | }; | |||
|
56 | widget_manager.notebook.events.on('kernel_disconnected.Kernel', died); | |||
|
57 | widget_manager.notebook.events.on('kernel_killed.Kernel', died); | |||
|
58 | widget_manager.notebook.events.on('kernel_restarting.Kernel', died); | |||
|
59 | widget_manager.notebook.events.on('kernel_dead.Kernel', died); | |||
|
60 | ||||
50 | return Backbone.Model.apply(this); |
|
61 | return Backbone.Model.apply(this); | |
51 | }, |
|
62 | }, | |
52 |
|
63 | |||
@@ -384,6 +395,13 b' define(["widgets/js/manager",' | |||||
384 | * Public constructor. |
|
395 | * Public constructor. | |
385 | */ |
|
396 | */ | |
386 | this.model.on('change',this.update,this); |
|
397 | this.model.on('change',this.update,this); | |
|
398 | this.model.on('comm:live', function() { | |||
|
399 | this.$el.removeClass('comm-dead'); | |||
|
400 | }, this); | |||
|
401 | this.model.on('comm:dead', function() { | |||
|
402 | this.$el.addClass('comm-dead'); | |||
|
403 | }, this); | |||
|
404 | ||||
387 | this.options = parameters.options; |
|
405 | this.options = parameters.options; | |
388 | this.on('displayed', function() { |
|
406 | this.on('displayed', function() { | |
389 | this.is_displayed = true; |
|
407 | this.is_displayed = true; |
General Comments 0
You need to be logged in to leave comments.
Login now