dialog working
This commit is contained in:
parent
68856aa894
commit
eea513528e
1 changed files with 11 additions and 2 deletions
13
src/index.ts
13
src/index.ts
|
@ -30,9 +30,12 @@ class IFrameWidget extends Widget {
|
|||
div.classList.add('iframe-widget');
|
||||
let iframe = document.createElement('iframe');
|
||||
iframe.src = path;
|
||||
this.iframe = iframe;
|
||||
div.appendChild(iframe);
|
||||
this.node.appendChild(div);
|
||||
}
|
||||
|
||||
iframe: HTMLIFrameElement;
|
||||
};
|
||||
|
||||
class OpenIFrameWidget extends Widget {
|
||||
|
@ -86,12 +89,18 @@ function activate(app: JupyterLab, docManager: IDocumentManager, palette: IComma
|
|||
return null;
|
||||
}
|
||||
path = <string>result.value;
|
||||
widget = new IFrameWidget(path);
|
||||
if (!widget){
|
||||
widget = new IFrameWidget(path);
|
||||
}
|
||||
widget.iframe.src = path;
|
||||
app.shell.addToMainArea(widget);
|
||||
app.shell.activateById(widget.id);
|
||||
});
|
||||
} else {
|
||||
widget = new IFrameWidget(path);
|
||||
if (!widget){
|
||||
widget = new IFrameWidget(path);
|
||||
}
|
||||
widget.iframe.src = path;
|
||||
app.shell.addToMainArea(widget);
|
||||
app.shell.activateById(widget.id);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue