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


TypeScript StyleMutator.setVisibility方法代碼示例

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


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

示例1:

		this._requestModificationFrame(() => {
			let widgetId:string,
				widget:IWidgetData,
				domNode: HTMLElement;

			for (widgetId in this._widgets) {
				if (this._widgets.hasOwnProperty(widgetId)) {
					widget = this._widgets[widgetId];
					domNode = this._widgets[widgetId].widget.getDomNode();

					if (data.hasOwnProperty(widgetId)) {
						if (widget.allowEditorOverflow) {
							StyleMutator.setTop(domNode, data[widgetId].top);
							StyleMutator.setLeft(domNode, data[widgetId].left);
						} else {
							StyleMutator.setTop(domNode, data[widgetId].top + ctx.viewportTop - ctx.bigNumbersDelta);
							StyleMutator.setLeft(domNode, data[widgetId].left);
						}
						if (!widget.isVisible) {
							StyleMutator.setVisibility(domNode, 'inherit');
							domNode.setAttribute('monaco-visible-content-widget', 'true');
							widget.isVisible = true;
						}
					} else {
						if (widget.isVisible) {
							domNode.removeAttribute('monaco-visible-content-widget');
							widget.isVisible = false;
							StyleMutator.setVisibility(domNode, 'hidden');
						}
					}
				}
			}
		});
開發者ID:1424667164,項目名稱:vscode,代碼行數:33,代碼來源:contentWidgets.ts

示例2: render

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

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

			if (data.hasOwnProperty(widgetId)) {
				if (widget.allowEditorOverflow) {
					StyleMutator.setTop(domNode, data[widgetId].top);
					StyleMutator.setLeft(domNode, data[widgetId].left);
				} else {
					StyleMutator.setTop(domNode, data[widgetId].top + ctx.viewportTop - ctx.bigNumbersDelta);
					StyleMutator.setLeft(domNode, data[widgetId].left);
				}
				if (!widget.isVisible) {
					StyleMutator.setVisibility(domNode, 'inherit');
					domNode.setAttribute('monaco-visible-content-widget', 'true');
					widget.isVisible = true;
				}
			} else {
				if (widget.isVisible) {
					domNode.removeAttribute('monaco-visible-content-widget');
					widget.isVisible = false;
					StyleMutator.setVisibility(domNode, 'hidden');
				}
			}
		}
	}
開發者ID:firebull1,項目名稱:vscode,代碼行數:31,代碼來源:contentWidgets.ts

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

示例4: hide

	public hide(): void {
		if (this._isVisible) {
			StyleMutator.setVisibility(this._domNode, 'hidden');
			this._isVisible = false;
		}
	}
開發者ID:1833183060,項目名稱:vscode,代碼行數:6,代碼來源:viewCursor.ts

示例5: show

	public show(): void {
		if (!this._isVisible) {
			StyleMutator.setVisibility(this._domNode, 'inherit');
			this._isVisible = true;
		}
	}
開發者ID:1833183060,項目名稱:vscode,代碼行數:6,代碼來源:viewCursor.ts


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