Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
super();
this.addClass('jp-Dialog');
let normalized = Private.handleOptions(options);
let renderer = normalized.renderer;
this._host = normalized.host;
this._defaultButton = normalized.defaultButton;
this._buttons = normalized.buttons;
this._buttonNodes = toArray(
map(this._buttons, button => {
return renderer.createButtonNode(button);
})
);
let layout = (this.layout = new PanelLayout());
let content = new Panel();
content.addClass('jp-Dialog-content');
layout.addWidget(content);
this._body = normalized.body;
let header = renderer.createHeader(normalized.title);
let body = renderer.createBody(normalized.body);
let footer = renderer.createFooter(this._buttonNodes);
content.addWidget(header);
content.addWidget(body);
content.addWidget(footer);
this._primary = this._buttonNodes[this._defaultButton];
this._focusNodeSelector = options.focusNodeSelector;
// Add new dialogs to the tracker.
it('should emit a signal when completer visibility changes', async () => {
let panel = new Panel();
let code = createEditorWidget();
let editor = code.editor;
let model = new CompleterModel();
let called = false;
editor.model.value.text = 'a';
panel.node.style.position = 'absolute';
panel.node.style.top = '0px';
panel.node.style.left = '0px';
panel.node.style.height = '1000px';
code.node.style.height = '900px';
panel.addWidget(code);
Widget.attach(panel, document.body);
panel.node.scrollTop = 0;
document.body.scrollTop = 0;
it('should preserve the tracked widget on widget disposal', () => {
const panel = new Panel();
const widgets = [createWidget(), createWidget(), createWidget()];
widgets.forEach(widget => {
void tracker.add(widget);
panel.addWidget(widget);
});
Widget.attach(panel, document.body);
focus(widgets[0]);
expect(tracker.currentWidget).to.equal(widgets[0]);
let called = false;
tracker.currentChanged.connect(() => {
called = true;
});
widgets[2].dispose();
constructor() {
super();
this.addClass(barStyle);
let rootLayout = (this.layout = new PanelLayout());
let leftPanel = (this._leftSide = new Panel());
let middlePanel = (this._middlePanel = new Panel());
let rightPanel = (this._rightSide = new Panel());
leftPanel.addClass(sideStyle);
leftPanel.addClass(leftSideStyle);
middlePanel.addClass(sideStyle);
rightPanel.addClass(sideStyle);
rightPanel.addClass(rightSideStyle);
rootLayout.addWidget(leftPanel);
rootLayout.addWidget(middlePanel);
rootLayout.addWidget(rightPanel);
}
constructor() {
super();
this.addClass(barStyle);
let rootLayout = (this.layout = new PanelLayout());
let leftPanel = (this._leftSide = new Panel());
let middlePanel = (this._middlePanel = new Panel());
let rightPanel = (this._rightSide = new Panel());
leftPanel.addClass(sideStyle);
leftPanel.addClass(leftSideStyle);
middlePanel.addClass(sideStyle);
rightPanel.addClass(sideStyle);
rightPanel.addClass(rightSideStyle);
rootLayout.addWidget(leftPanel);
rootLayout.addWidget(middlePanel);
rootLayout.addWidget(rightPanel);
}
constructor(options: Collapse.IOptions) {
super(options);
const { widget, collapsed = true } = options;
this.addClass('jp-Collapse');
this._header = new Widget();
this._header.addClass('jp-Collapse-header');
this._content = new Panel();
this._content.addClass('jp-Collapse-contents');
let layout = new PanelLayout();
this.layout = layout;
layout.addWidget(this._header);
layout.addWidget(this._content);
this.widget = widget;
this.collapsed = collapsed;
}
constructor() {
super();
this.addClass(APPLICATION_SHELL_CLASS);
this.id = 'main';
let headerPanel = (this._headerPanel = new Panel());
let topHandler = (this._topHandler = new Private.PanelHandler());
let bottomPanel = (this._bottomPanel = new BoxPanel());
let hboxPanel = new BoxPanel();
let dockPanel = (this._dockPanel = new DockPanelSvg({
kind: 'dockPanelBar'
}));
MessageLoop.installMessageHook(dockPanel, this._dockChildHook);
let hsplitPanel = new SplitPanel();
let leftHandler = (this._leftHandler = new Private.SideBarHandler());
let rightHandler = (this._rightHandler = new Private.SideBarHandler());
let rootLayout = new BoxLayout();
headerPanel.id = 'jp-header-panel';
topHandler.panel.id = 'jp-top-panel';
bottomPanel.id = 'jp-bottom-panel';
constructor() {
super();
this.addClass(barStyle);
let rootLayout = (this.layout = new PanelLayout());
let leftPanel = (this._leftSide = new Panel());
let middlePanel = (this._middlePanel = new Panel());
let rightPanel = (this._rightSide = new Panel());
leftPanel.addClass(sideStyle);
leftPanel.addClass(leftSideStyle);
middlePanel.addClass(sideStyle);
rightPanel.addClass(sideStyle);
rightPanel.addClass(rightSideStyle);
rootLayout.addWidget(leftPanel);
rootLayout.addWidget(middlePanel);
rootLayout.addWidget(rightPanel);
}