Added support for the labmode comms
@@ -272,8 +272,8 @@ class JupyterCommManager(CommManager):
}
JupyterCommManager.prototype.register_target = function(plot_id, comm_id, msg_handler) {
- if ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null)) {
- var comm_manager = Jupyter.notebook.kernel.comm_manager;
+ if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {
+ var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;
comm_manager.register_target(comm_id, function(comm) {
comm.on_msg(msg_handler);
});
@@ -287,8 +287,8 @@ class JupyterCommManager(CommManager):
JupyterCommManager.prototype.get_client_comm = function(plot_id, comm_id, msg_handler) {
if (comm_id in window.HoloViews.comms) {
return HoloViews.comms[comm_id];
- } else if ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null)) {
- var comm_manager = Jupyter.notebook.kernel.comm_manager;
+ } else if (window.comm_manager || ((window.Jupyter !== undefined) && (Jupyter.notebook.kernel != null))) {
+ var comm_manager = window.comm_manager || Jupyter.notebook.kernel.comm_manager;
var comm = comm_manager.new_comm(comm_id, {}, {}, {}, comm_id);
if (msg_handler) {
comm.on_msg(msg_handler);
