Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
addBanner() {
if (this._banner) {
// An old banner just becomes a normal cell now.
let cell = this._banner;
this._cells.push(this._banner);
cell.disposed.connect(this._onCellDisposed, this);
}
// Create the banner.
let banner = (this._banner = new RawCell({
contentFactory: this.contentFactory
}));
banner.editor.model.value = '...';
banner.addClass(BANNER_CLASS);
banner.readOnly = true;
this._content.addWidget(banner);
}
addBanner() {
if (this._banner) {
// An old banner just becomes a normal cell now.
let cell = this._banner;
this._cells.push(this._banner);
cell.disposed.connect(
this._onCellDisposed,
this
);
}
// Create the banner.
let model = this.modelFactory.createRawCell({});
model.value.text = '...';
let banner = (this._banner = new RawCell({
model,
contentFactory: this.contentFactory
})).initializeState();
banner.addClass(BANNER_CLASS);
banner.readOnly = true;
this._content.addWidget(banner);
}
addBanner() {
if (this._banner) {
// An old banner just becomes a normal cell now.
let cell = this._banner;
this._cells.push(this._banner);
cell.disposed.connect(
this._onCellDisposed,
this
);
}
// Create the banner.
let model = this.modelFactory.createRawCell({});
model.value.text = '...';
let banner = (this._banner = new RawCell({
model,
contentFactory: this.contentFactory
}));
banner.addClass(BANNER_CLASS);
banner.readOnly = true;
this._content.addWidget(banner);
}
it('should create a raw cell widget', () => {
const model = new RawCellModel({});
const widget = new RawCell({ model, contentFactory }).initializeState();
expect(widget).toBeInstanceOf(RawCell);
});
});
it('should create a raw cell widget', () => {
const model = new RawCellModel({});
const widget = new RawCell({ model, contentFactory }).initializeState();
expect(widget).toBeInstanceOf(RawCell);
});
});
createRawCell(options: RawCell.IOptions): RawCell {
if (!options.contentFactory) {
options.contentFactory = this;
}
return new RawCell(options).initializeState();
}
}
createRawCell(options: RawCell.IOptions, parent: StaticNotebook): RawCell {
if (!options.contentFactory) {
options.contentFactory = this;
}
return new RawCell(options).initializeState();
}
}
createRawCell(options: RawCell.IOptions): RawCell {
if (!options.contentFactory) {
options.contentFactory = this;
}
return new RawCell(options);
}
}