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


TypeScript StyleMutator.setDisplay方法代码示例

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


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

示例1: addZone

	public addZone(zone: IViewZone): number {
		let props = this._computeWhitespaceProps(zone);
		let whitespaceId = this._whitespaceManager.addWhitespace(props.afterViewLineNumber, this._getZoneOrdinal(zone), props.heightInPx);

		let myZone: IMyViewZone = {
			whitespaceId: whitespaceId,
			delegate: zone,
			isVisible: false
		};

		this._safeCallOnComputedHeight(myZone.delegate, props.heightInPx);

		myZone.delegate.domNode.style.position = 'absolute';
		myZone.delegate.domNode.style.width = '100%';
		StyleMutator.setDisplay(myZone.delegate.domNode, 'none');
		myZone.delegate.domNode.setAttribute('monaco-view-zone', myZone.whitespaceId.toString());
		this.domNode.appendChild(myZone.delegate.domNode);

		if (myZone.delegate.marginDomNode) {
			myZone.delegate.marginDomNode.style.position = 'absolute';
			myZone.delegate.marginDomNode.style.width = '100%';
			StyleMutator.setDisplay(myZone.delegate.marginDomNode, 'none');
			myZone.delegate.marginDomNode.setAttribute('monaco-view-zone', myZone.whitespaceId.toString());
			this.marginDomNode.appendChild(myZone.delegate.marginDomNode);
		}

		this._zones[myZone.whitespaceId.toString()] = myZone;


		this.setShouldRender();

		return myZone.whitespaceId;
	}
开发者ID:StateFarmIns,项目名称:vscode,代码行数:33,代码来源:viewZones.ts

示例2: render

	public render(ctx:EditorBrowser.IRestrictedRenderingContext): void {
		if (this._isInViewport) {
			StyleMutator.setDisplay(this._domNode, 'block');
			StyleMutator.setLeft(this._domNode, this._positionLeft);
			StyleMutator.setTop(this._domNode, this._positionTop + ctx.viewportTop - ctx.bigNumbersDelta);
		} else {
			StyleMutator.setDisplay(this._domNode, 'none');
		}
	}
开发者ID:ErickWendel,项目名称:vscode,代码行数:9,代码来源:viewCursor.ts

示例3: render

	public render(ctx: IRestrictedRenderingContext): void {
		let visibleWhitespaces = this._whitespaceManager.getWhitespaceViewportData();
		let visibleZones: { [id: string]: editorCommon.IViewWhitespaceViewportData; } = {};

		let hasVisibleZone = false;
		for (let i = 0, len = visibleWhitespaces.length; i < len; i++) {
			visibleZones[visibleWhitespaces[i].id.toString()] = visibleWhitespaces[i];
			hasVisibleZone = true;
		}

		let keys = Object.keys(this._zones);
		for (let i = 0, len = keys.length; i < len; i++) {
			let id = keys[i];
			let zone = this._zones[id];

			let newTop = 0;
			let newHeight = 0;
			let newDisplay = 'none';
			if (visibleZones.hasOwnProperty(id)) {
				newTop = visibleZones[id].verticalOffset - ctx.bigNumbersDelta;
				newHeight = visibleZones[id].height;
				newDisplay = 'block';
				// zone is visible
				if (!zone.isVisible) {
					zone.delegate.domNode.setAttribute('monaco-visible-view-zone', 'true');
					zone.isVisible = true;
				}
				this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(visibleZones[id].verticalOffset));
			} else {
				if (zone.isVisible) {
					zone.delegate.domNode.removeAttribute('monaco-visible-view-zone');
					zone.isVisible = false;
				}
				this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(-1000000));
			}
			StyleMutator.setTop(zone.delegate.domNode, newTop);
			StyleMutator.setHeight(zone.delegate.domNode, newHeight);
			StyleMutator.setDisplay(zone.delegate.domNode, newDisplay);

			if (zone.delegate.marginDomNode) {
				StyleMutator.setTop(zone.delegate.marginDomNode, newTop);
				StyleMutator.setHeight(zone.delegate.marginDomNode, newHeight);
				StyleMutator.setDisplay(zone.delegate.marginDomNode, newDisplay);
			}
		}

		if (hasVisibleZone) {
			StyleMutator.setWidth(this.domNode, Math.max(ctx.scrollWidth, this._contentWidth));
			StyleMutator.setWidth(this.marginDomNode, this._contentLeft);
		}
	}
开发者ID:StateFarmIns,项目名称:vscode,代码行数:51,代码来源:viewZones.ts

示例4: render

	public render(ctx:IRestrictedRenderingContext): void {
		if (this._isInViewport) {
			let renderContent = this._getRenderedContent();
			if (this._lastRenderedContent !== renderContent) {
				this._lastRenderedContent = renderContent;
				this._domNode.textContent = this._lastRenderedContent;
			}

			StyleMutator.setDisplay(this._domNode, 'block');
			StyleMutator.setLeft(this._domNode, this._positionLeft);
			StyleMutator.setTop(this._domNode, this._positionTop + ctx.viewportTop - ctx.bigNumbersDelta);
			StyleMutator.setLineHeight(this._domNode, this._lineHeight);
			StyleMutator.setHeight(this._domNode, this._lineHeight);
		} else {
			StyleMutator.setDisplay(this._domNode, 'none');
		}
	}
开发者ID:1833183060,项目名称:vscode,代码行数:17,代码来源:viewCursor.ts

示例5:

		this._requestModificationFrame(() => {
			var visibleZones:{[id:string]:editorCommon.IViewWhitespaceViewportData;} = {},
				i:number,
				len:number,
				hasVisibleZone = false;

			for (i = 0, len = visibleWhitespaces.length; i < len; i++) {
				visibleZones[visibleWhitespaces[i].id.toString()] = visibleWhitespaces[i];
				hasVisibleZone = true;
			}

			var id:string,
				zone:IMyViewZone;

			for (id in this._zones) {
				if (this._zones.hasOwnProperty(id)) {
					zone = this._zones[id];

					if (visibleZones.hasOwnProperty(id)) {
						// zone is visible
						StyleMutator.setTop(zone.delegate.domNode, (visibleZones[id].verticalOffset - ctx.bigNumbersDelta));
						StyleMutator.setHeight(zone.delegate.domNode, visibleZones[id].height);
						if (!zone.isVisible) {
							StyleMutator.setDisplay(zone.delegate.domNode, 'block');
							zone.delegate.domNode.setAttribute('monaco-visible-view-zone', 'true');
							zone.isVisible = true;
						}
						this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(visibleZones[id].verticalOffset));
					} else {
						if (zone.isVisible) {
							StyleMutator.setDisplay(zone.delegate.domNode, 'none');
							zone.delegate.domNode.removeAttribute('monaco-visible-view-zone');
							zone.isVisible = false;
						}
						this._safeCallOnDomNodeTop(zone.delegate, ctx.getScrolledTopFromAbsoluteTop(-1000000));
					}
				}
			}

			if (hasVisibleZone) {
				StyleMutator.setWidth(this.domNode, ctx.scrollWidth);
			}
		});
开发者ID:1424667164,项目名称:vscode,代码行数:43,代码来源:viewZones.ts

示例6: constructor

	constructor(context:EditorBrowser.IViewContext, isSecondary:boolean) {
		this._context = context;

		this._isInEditableRange = true;

		this._domNode = this._createCursorDomNode(isSecondary);
		this._isVisible = true;
		StyleMutator.setDisplay(this._domNode, 'none');
		this.updatePosition({
			lineNumber: 1,
			column: 1
		});
	}
开发者ID:ErickWendel,项目名称:vscode,代码行数:13,代码来源:viewCursor.ts

示例7: constructor

	constructor(context:IViewContext, isSecondary:boolean) {
		this._context = context;
		this._cursorStyle = this._context.configuration.editor.cursorStyle;
		this._lineHeight = this._context.configuration.editor.lineHeight;
		this._lastRenderedContent = '';

		this._isInEditableRange = true;

		this._domNode = this._createCursorDomNode(isSecondary);
		this._isVisible = true;
		StyleMutator.setDisplay(this._domNode, 'none');
		this.updatePosition({
			lineNumber: 1,
			column: 1
		});
	}
开发者ID:1833183060,项目名称:vscode,代码行数:16,代码来源:viewCursor.ts


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