当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript StyleMutator.setMaxWidth方法代码示例

本文整理汇总了TypeScript中vs/base/browser/styleMutator.StyleMutator.setMaxWidth方法的典型用法代码示例。如果您正苦于以下问题:TypeScript StyleMutator.setMaxWidth方法的具体用法?TypeScript StyleMutator.setMaxWidth怎么用?TypeScript StyleMutator.setMaxWidth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vs/base/browser/styleMutator.StyleMutator的用法示例。


在下文中一共展示了StyleMutator.setMaxWidth方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

		this._requestModificationFrameBeforeRendering(() => {
			// update the maxWidth on widgets nodes, such that `onReadAfterForcedLayout`
			// below can read out the adjusted width/height of widgets
			let widgetId:string;
			for (widgetId in this._widgets) {
				if (this._widgets.hasOwnProperty(widgetId)) {
					StyleMutator.setMaxWidth(this._widgets[widgetId].widget.getDomNode(), this._contentWidth);
				}
			}
		});
开发者ID:1424667164,项目名称:vscode,代码行数:10,代码来源:contentWidgets.ts

示例2: onLayoutChanged

	public onLayoutChanged(layoutInfo:editorCommon.EditorLayoutInfo): boolean {
		this._contentLeft = layoutInfo.contentLeft;

		if (this._contentWidth !== layoutInfo.contentWidth) {
			this._contentWidth = layoutInfo.contentWidth;
			// update the maxWidth on widgets nodes, such that `onReadAfterForcedLayout`
			// below can read out the adjusted width/height of widgets
			let keys = Object.keys(this._widgets);
			for (let i = 0, len = keys.length; i < len; i++) {
				let widgetId = keys[i];
				StyleMutator.setMaxWidth(this._widgets[widgetId].widget.getDomNode(), this._contentWidth);
			}
		}

		return true;
	}
开发者ID:firebull1,项目名称:vscode,代码行数:16,代码来源:contentWidgets.ts

示例3: onLayoutChanged

	public onLayoutChanged(layoutInfo: editorCommon.EditorLayoutInfo): boolean {
		this._contentLeft = layoutInfo.contentLeft;

		if (this._contentWidth !== layoutInfo.contentWidth) {
			this._contentWidth = layoutInfo.contentWidth;
			// update the maxWidth on widgets nodes, such that `onReadAfterForcedLayout`
			// below can read out the adjusted width/height of widgets
			let keys = Object.keys(this._widgets);
			for (let i = 0, len = keys.length; i < len; i++) {
				const widgetId = keys[i];
				const widgetData = this._widgets[widgetId];
				const widget = widgetData.widget;
				const maxWidth = widgetData.allowEditorOverflow
					? window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
					: this._contentWidth;

				StyleMutator.setMaxWidth(widget.getDomNode(), maxWidth);
			}
		}

		return true;
	}
开发者ID:pk-codebox-evo,项目名称:ide-microsoft-vscode,代码行数:22,代码来源:contentWidgets.ts

示例4: addWidget

	public addWidget(widget: IContentWidget): void {
		let widgetData: IWidgetData = {
			allowEditorOverflow: widget.allowEditorOverflow || false,
			widget: widget,
			position: null,
			preference: null,
			isVisible: false
		};
		this._widgets[widget.getId()] = widgetData;

		let domNode = widget.getDomNode();
		domNode.style.position = 'absolute';
		StyleMutator.setMaxWidth(domNode, this._contentWidth);
		StyleMutator.setVisibility(domNode, 'hidden');
		domNode.setAttribute('widgetId', widget.getId());

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

		this.shouldRender = true;
	}
开发者ID:1424667164,项目名称:vscode,代码行数:24,代码来源:contentWidgets.ts


注:本文中的vs/base/browser/styleMutator.StyleMutator.setMaxWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。