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


TypeScript FastDomNode.setVisibility方法代码示例

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


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

示例1: render

	public render(ctx: RestrictedRenderingContext): void {
		if (!this._renderData) {
			// This widget should be invisible
			if (this._isVisible) {
				this.domNode.removeAttribute('monaco-visible-content-widget');
				this._isVisible = false;
				this.domNode.setVisibility('hidden');
			}
			return;
		}

		// This widget should be visible
		if (this.allowEditorOverflow) {
			this.domNode.setTop(this._renderData.top);
			this.domNode.setLeft(this._renderData.left);
		} else {
			this.domNode.setTop(this._renderData.top + ctx.scrollTop - ctx.bigNumbersDelta);
			this.domNode.setLeft(this._renderData.left);
		}

		if (!this._isVisible) {
			this.domNode.setVisibility('inherit');
			this.domNode.setAttribute('monaco-visible-content-widget', 'true');
			this._isVisible = true;
		}
	}
开发者ID:Chan-PH,项目名称:vscode,代码行数:26,代码来源:contentWidgets.ts

示例2: render

	public render(ctx: RestrictedRenderingContext): void {
		let data = this._renderData;

		let keys = Object.keys(this._widgets);
		for (let i = 0, len = keys.length; i < len; i++) {
			const widgetId = keys[i];
			const widget = this._widgets[widgetId];
			const domNode = widget.domNode;

			if (data.hasOwnProperty(widgetId)) {
				if (widget.allowEditorOverflow) {
					domNode.setTop(data[widgetId].top);
					domNode.setLeft(data[widgetId].left);
				} else {
					domNode.setTop(data[widgetId].top + ctx.scrollTop - ctx.bigNumbersDelta);
					domNode.setLeft(data[widgetId].left);
				}
				if (!widget.isVisible) {
					domNode.setVisibility('inherit');
					domNode.setAttribute('monaco-visible-content-widget', 'true');
					widget.isVisible = true;
				}
			} else {
				if (widget.isVisible) {
					domNode.removeAttribute('monaco-visible-content-widget');
					widget.isVisible = false;
					domNode.setVisibility('hidden');
				}
			}
		}
	}
开发者ID:wangcheng678,项目名称:vscode,代码行数:31,代码来源:contentWidgets.ts

示例3: 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._position = null;
		this._preference = null;
		this._isVisible = false;
		this._renderData = null;

		this.domNode.setPosition((this._fixedOverflowWidgets && this.allowEditorOverflow) ? 'fixed' : 'absolute');
		this._updateMaxWidth();
		this.domNode.setVisibility('hidden');
		this.domNode.setAttribute('widgetId', this.id);
	}
开发者ID:Chan-PH,项目名称:vscode,代码行数:25,代码来源:contentWidgets.ts

示例4: 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

示例5: show

	public show(): void {
		if (!this._isVisible) {
			this._domNode.setVisibility('inherit');
			this._isVisible = true;
		}
	}
开发者ID:yuit,项目名称:vscode,代码行数:6,代码来源:viewCursor.ts

示例6: hide

	public hide(): void {
		if (this._isVisible) {
			this._domNode.setVisibility('hidden');
			this._isVisible = false;
		}
	}
开发者ID:yuit,项目名称:vscode,代码行数:6,代码来源:viewCursor.ts


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