本文整理匯總了TypeScript中vs/base/browser/builder.Builder.div方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Builder.div方法的具體用法?TypeScript Builder.div怎麽用?TypeScript Builder.div使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vs/base/browser/builder.Builder
的用法示例。
在下文中一共展示了Builder.div方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: test
test('Creation', function () {
let b = new Builder(document.getElementById(fixtureId));
b.div().hide();
let part = new MyPart(b.getHTMLElement());
part.create(b.getHTMLElement());
assert.strictEqual(part.getId(), 'myPart');
// Memento
let memento = part.getMemento(storage);
assert(memento);
memento.foo = 'bar';
memento.bar = [1, 2, 3];
part.shutdown();
// Re-Create to assert memento contents
part = new MyPart(b.getHTMLElement());
memento = part.getMemento(storage);
assert(memento);
assert.strictEqual(memento.foo, 'bar');
assert.strictEqual(memento.bar.length, 3);
// Empty Memento stores empty object
delete memento.foo;
delete memento.bar;
part.shutdown();
part = new MyPart(b.getHTMLElement());
memento = part.getMemento(storage);
assert(memento);
assert.strictEqual(Types.isEmptyObject(memento), true);
});
示例2: create
private create(parent: Builder): void {
parent.div({ 'class': css_progress_container }, (builder) => {
this.element = builder.clone();
builder.div({ 'class': css_progress_bit }).on([DOM.EventType.ANIMATION_START, DOM.EventType.ANIMATION_END, DOM.EventType.ANIMATION_ITERATION], (e: Event) => {
switch (e.type) {
case DOM.EventType.ANIMATION_START:
case DOM.EventType.ANIMATION_END:
this.animationRunning = e.type === DOM.EventType.ANIMATION_START;
break;
case DOM.EventType.ANIMATION_ITERATION:
if (this.animationStopToken) {
this.animationStopToken(null);
}
break;
}
}, this.toUnbind);
this.bit = builder.getHTMLElement();
});
this.applyStyles();
}
示例3: measureFont
private measureFont(fontFamily: string, fontWeight: string,fontSize: number, lineHeight: number): ITerminalFont {
// Create charMeasureElement if it hasn't been created or if it was orphaned by its parent
if (!this.charMeasureElement || !this.charMeasureElement.parentElement) {
this.charMeasureElement = this.panelContainer.div().getHTMLElement();
}
let style = this.charMeasureElement.style;
style.display = 'block';
style.fontFamily = fontFamily;
style.fontWeight = fontWeight;
style.fontSize = fontSize + 'px';
style.height = Math.floor(lineHeight * fontSize) + 'px';
this.charMeasureElement.innerText = 'X';
let rect = this.charMeasureElement.getBoundingClientRect();
style.display = 'none';
let charWidth = Math.ceil(rect.width);
let charHeight = Math.ceil(rect.height);
return {
fontFamily,
fontWeight,
fontSize: fontSize + 'px',
lineHeight,
charWidth,
charHeight
};
}
示例4: createContentArea
public createContentArea(parent: Builder): Builder {
return parent.div(function (div) {
div.span({
id: 'myPart.content',
innerHtml: 'Content'
});
});
}
示例5: createStatusArea
public createStatusArea(parent: Builder): Builder {
return parent.div(function (div) {
div.span({
id: 'myPart.status',
innerHtml: 'Status'
});
});
}
示例6: createTitleArea
public createTitleArea(parent: Builder): Builder {
return parent.div(function (div) {
div.span({
id: 'myPart.title',
innerHtml: 'Title'
});
});
}