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


TypeScript styleMutator.StyleMutator类代码示例

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


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

示例1: _renderWidget

	private _renderWidget(widgetData: IWidgetData): void {
		var _RESTORE_STYLE_TOP = 'data-editor-restoreStyleTop',
			domNode = widgetData.widget.getDomNode();

		if (widgetData.preference === null) {
			if (domNode.hasAttribute(_RESTORE_STYLE_TOP)) {
				var previousTop = domNode.getAttribute(_RESTORE_STYLE_TOP);
				domNode.removeAttribute(_RESTORE_STYLE_TOP);
				domNode.style.top = previousTop;
			}
			return;
		}

		if (widgetData.preference === OverlayWidgetPositionPreference.TOP_RIGHT_CORNER) {
			if (!domNode.hasAttribute(_RESTORE_STYLE_TOP)) {
				domNode.setAttribute(_RESTORE_STYLE_TOP, domNode.style.top);
			}
			StyleMutator.setTop(domNode, 0);
			StyleMutator.setRight(domNode, (2 * this._verticalScrollbarWidth));
		} else if (widgetData.preference === OverlayWidgetPositionPreference.BOTTOM_RIGHT_CORNER) {
			if (!domNode.hasAttribute(_RESTORE_STYLE_TOP)) {
				domNode.setAttribute(_RESTORE_STYLE_TOP, domNode.style.top);
			}
			var widgetHeight = domNode.clientHeight;
			StyleMutator.setTop(domNode, (this._editorHeight - widgetHeight - 2 * this._horizontalScrollbarHeight));
			StyleMutator.setRight(domNode, (2 * this._verticalScrollbarWidth));
		} else if (widgetData.preference === OverlayWidgetPositionPreference.TOP_CENTER) {
			if (!domNode.hasAttribute(_RESTORE_STYLE_TOP)) {
				domNode.setAttribute(_RESTORE_STYLE_TOP, domNode.style.top);
			}
			StyleMutator.setTop(domNode, 0);
			domNode.style.right = '50%';
		}
	}
开发者ID:1424667164,项目名称:vscode,代码行数:34,代码来源:overlayWidgets.ts

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

示例3: _updateSlider

	protected _updateSlider(sliderSize: number, sliderPosition: number): void {
		StyleMutator.setWidth(this.slider, sliderSize);
		if (!this._forbidTranslate3dUse && Browser.canUseTranslate3d) {
			StyleMutator.setTransform(this.slider, 'translate3d(' + sliderPosition + 'px, 0px, 0px)');
		} else {
			StyleMutator.setLeft(this.slider, sliderPosition);
		}
	}
开发者ID:ErickWendel,项目名称:vscode,代码行数:8,代码来源:horizontalScrollbar.ts

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

示例5:

		this._requestModificationFrame(() => {
			if (!myZone.delegate.domNode.hasAttribute('monaco-view-zone')) {
				// Do not position zone if it was removed in the meantime
				return;
			}
			myZone.delegate.domNode.style.position = 'absolute';
			StyleMutator.setHeight(myZone.delegate.domNode, computedHeight);
			myZone.delegate.domNode.style.width = '100%';
			StyleMutator.setDisplay(myZone.delegate.domNode, 'none');
		});
开发者ID:1424667164,项目名称:vscode,代码行数:10,代码来源:viewZones.ts

示例6: _createCursorDomNode

	private _createCursorDomNode(isSecondary: boolean): HTMLElement {
		var domNode = document.createElement('div');
		domNode.className = 'cursor';
		if (isSecondary) {
			domNode.className += ' secondary';
		}
		StyleMutator.setHeight(domNode, this._lineHeight);
		StyleMutator.setTop(domNode, 0);
		StyleMutator.setLeft(domNode, 0);
		domNode.setAttribute('role', 'presentation');
		domNode.setAttribute('aria-hidden', 'true');
		return domNode;
	}
开发者ID:1833183060,项目名称:vscode,代码行数:13,代码来源:viewCursor.ts

示例7: render

	public render(ctx:IRestrictedRenderingContext): void {
		StyleMutator.setWidth(this.domNode, this._editorWidth);

		let keys = Object.keys(this._widgets);
		for (let i = 0, len = keys.length; i < len; i++) {
			let widgetId = keys[i];
			this._renderWidget(this._widgets[widgetId]);
		}
	}
开发者ID:Clizhuowei,项目名称:vscode,代码行数:9,代码来源:overlayWidgets.ts

示例8:

		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


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