當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Builder.div方法代碼示例

本文整理匯總了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);
	});
開發者ID:liunian,項目名稱:vscode,代碼行數:35,代碼來源:part.test.ts

示例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();
	}
開發者ID:Chan-PH,項目名稱:vscode,代碼行數:25,代碼來源:progressbar.ts

示例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
		};
	}
開發者ID:douglaseccker,項目名稱:vscode,代碼行數:25,代碼來源:terminalConfigHelper.ts

示例4: createContentArea

	public createContentArea(parent: Builder): Builder {
		return parent.div(function (div) {
			div.span({
				id: 'myPart.content',
				innerHtml: 'Content'
			});
		});
	}
開發者ID:elemongw,項目名稱:vscode,代碼行數:8,代碼來源:part.test.ts

示例5: createStatusArea

	public createStatusArea(parent: Builder): Builder {
		return parent.div(function (div) {
			div.span({
				id: 'myPart.status',
				innerHtml: 'Status'
			});
		});
	}
開發者ID:elemongw,項目名稱:vscode,代碼行數:8,代碼來源:part.test.ts

示例6: createTitleArea

	public createTitleArea(parent: Builder): Builder {
		return parent.div(function (div) {
			div.span({
				id: 'myPart.title',
				innerHtml: 'Title'
			});
		});
	}
開發者ID:elemongw,項目名稱:vscode,代碼行數:8,代碼來源:part.test.ts


注:本文中的vs/base/browser/builder.Builder.div方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。