Skip to content
Permalink
Browse files

Use the view.cid unique id as an identifying id.

  • Loading branch information...
jasongrout committed Apr 13, 2017
1 parent 00b16dc commit 17b7ae7a5caa9e14d12c38fb800dbef888288aae
Showing with 7 additions and 2 deletions.
  1. +7 −2 widgetsnbextension/src/extension.js
@@ -48,6 +48,10 @@ function register_events(Jupyter, events, outputarea) {
handle_kernel(Jupyter, data.kernel);
});

/**
* The views on this page. We keep this list so that we can call the view.remove()
* method when a view is removed from the page.
*/
var views = {};
var removeView = function(event, data) {
var output = data.cell.output_area;
@@ -90,9 +94,10 @@ function register_events(Jupyter, events, outputarea) {
model.then(function(model) {
return manager.display_model(void 0, model, void 0);
}).then(function(view) {
var id = view.cid;
output._jupyterWidgetViews = output._jupyterWidgetViews || [];
output._jupyterWidgetViews.push(view.id);
views[view.id] = view;
output._jupyterWidgetViews.push(id);
views[id] = view;
PhosphorWidget.Widget.attach(view.pWidget, node);
});
} else {

0 comments on commit 17b7ae7

Please sign in to comment.
You can’t perform that action at this time.