本文整理匯總了TypeScript中phosphor/lib/ui/widget.Widget.attach方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Widget.attach方法的具體用法?TypeScript Widget.attach怎麽用?TypeScript Widget.attach使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類phosphor/lib/ui/widget.Widget
的用法示例。
在下文中一共展示了Widget.attach方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should save when clicked', () => {
let button = ToolbarItems.createSaveButton(panel);
Widget.attach(button, document.body);
button.node.click();
expect(context.methods).to.contain('save');
button.dispose();
});
示例2: it
it('should create a widget for a simple realistic model', () => {
let model = new NotebookMergeModel(
notebook, NBdecisions);
let widget = new NotebookMergeWidget(model, rendermime);
expect(widget).to.not.be(null);
Widget.attach(widget, document.body);
});
示例3: function
return Promise.resolve(view).then((view) => {
PWidget.Widget.attach(view.pWidget, this.el);
view.on('remove', function() {
console.log('view removed', view);
});
return view;
});
示例4: function
return Promise.resolve(view).then(function(view) {
PhosphorWidget.Widget.attach(view.pWidget, options.el);
view.on('remove', function() {
console.log('View removed', view);
});
return view;
});
示例5: it
it('should insert below when clicked', () => {
let button = ToolbarItems.createInsertButton(panel);
Widget.attach(button, document.body);
button.node.click();
expect(panel.content.activeCellIndex).to.be(1);
expect(panel.content.activeCell).to.be.a(CodeCellWidget);
button.dispose();
});
示例6: it
it('should execute a script tag when attached', () => {
const source = '<script>window.y=3;</script>';
let t = new HTMLRenderer();
let w = t.render({ mimetype: 'text/html', source });
expect((window as any).y).to.be(void 0);
Widget.attach(w, document.body);
expect((window as any).y).to.be(3);
w.dispose();
});
示例7: it
it('should apply alignContent if attached before setting', (done) => {
let p = new FlexPanel();
Widget.attach(p, document.body);
p.alignContent = 'center';
requestAnimationFrame(() => {
expect(p.node.style.alignContent).to.be('center');
p.dispose();
done();
});
});