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


TypeScript FastDomNode.setMaxWidth方法代碼示例

本文整理匯總了TypeScript中vs/base/browser/fastDomNode.FastDomNode.setMaxWidth方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript FastDomNode.setMaxWidth方法的具體用法?TypeScript FastDomNode.setMaxWidth怎麽用?TypeScript FastDomNode.setMaxWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vs/base/browser/fastDomNode.FastDomNode的用法示例。


在下文中一共展示了FastDomNode.setMaxWidth方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: _updateMaxWidth

	private _updateMaxWidth(): void {
		const maxWidth = this.allowEditorOverflow
			? window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
			: this._contentWidth;

		this.domNode.setMaxWidth(maxWidth);
	}
開發者ID:Chan-PH,項目名稱:vscode,代碼行數:7,代碼來源:contentWidgets.ts

示例2: constructor

	constructor(context: ViewContext, viewDomNode: FastDomNode<HTMLElement>, actual: IContentWidget) {
		this._context = context;
		this._viewDomNode = viewDomNode;
		this._actual = actual;
		this.domNode = createFastDomNode(this._actual.getDomNode());

		this.id = this._actual.getId();
		this.allowEditorOverflow = this._actual.allowEditorOverflow || false;
		this.suppressMouseDown = this._actual.suppressMouseDown || false;

		this._fixedOverflowWidgets = this._context.configuration.editor.viewInfo.fixedOverflowWidgets;
		this._contentWidth = this._context.configuration.editor.layoutInfo.contentWidth;
		this._contentLeft = this._context.configuration.editor.layoutInfo.contentLeft;
		this._lineHeight = this._context.configuration.editor.lineHeight;

		this._setPosition(null, null);
		this._preference = [];
		this._cachedDomNodeClientWidth = -1;
		this._cachedDomNodeClientHeight = -1;
		this._maxWidth = this._getMaxWidth();
		this._isVisible = false;
		this._renderData = null;

		this.domNode.setPosition((this._fixedOverflowWidgets && this.allowEditorOverflow) ? 'fixed' : 'absolute');
		this.domNode.setVisibility('hidden');
		this.domNode.setAttribute('widgetId', this.id);
		this.domNode.setMaxWidth(this._maxWidth);
	}
開發者ID:VishalMadhvani,項目名稱:vscode,代碼行數:28,代碼來源:contentWidgets.ts

示例3: addWidget

	public addWidget(widget: IContentWidget): void {
		const domNode = createFastDomNode(widget.getDomNode());

		const widgetData: IWidgetData = {
			allowEditorOverflow: widget.allowEditorOverflow || false,
			widget: widget,
			position: null,
			preference: null,
			isVisible: false,
			domNode: domNode
		};
		this._widgets[widget.getId()] = widgetData;

		domNode.setPosition((this._context.configuration.editor.viewInfo.fixedOverflowWidgets && widget.allowEditorOverflow) ? 'fixed' : 'absolute');
		domNode.setMaxWidth(this._contentWidth);
		domNode.setVisibility('hidden');
		domNode.setAttribute('widgetId', widget.getId());

		if (widgetData.allowEditorOverflow) {
			this.overflowingContentWidgetsDomNode.appendChild(domNode);
		} else {
			this.domNode.appendChild(domNode);
		}

		this.setShouldRender();
	}
開發者ID:wangcheng678,項目名稱:vscode,代碼行數:26,代碼來源:contentWidgets.ts

示例4: onBeforeRender

	/**
	 * On this first pass, we ensure that the content widget (if it is in the viewport) has the max width set correctly.
	 */
	public onBeforeRender(viewportData: ViewportData): void {
		if (!this._viewPosition || !this._preference) {
			return;
		}

		if (this._viewPosition.lineNumber < viewportData.startLineNumber || this._viewPosition.lineNumber > viewportData.endLineNumber) {
			// Outside of viewport
			return;
		}

		this.domNode.setMaxWidth(this._maxWidth);
	}
開發者ID:VishalMadhvani,項目名稱:vscode,代碼行數:15,代碼來源:contentWidgets.ts


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